Skip to content

Commit 79e24e9

Browse files
authored
Removed task library support (#4)
- The task and versioning support are now in distinct repos - This one supports ONLY the versioning library and leverages the task library. >NOTE: > This does NOT change core code, only the build, solution and projects to support a standalone repo for the versioning library. Co-authored-by: smaillet <25911635+smaillet@users.noreply.github.com>
1 parent ac87ffb commit 79e24e9

48 files changed

Lines changed: 33 additions & 4409 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Build-Docs.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,14 @@ try
7070
# Thus, for now, this uses the docfx build phase.]
7171
"$([DateTime]::UtcNow.ToString('o'))" | Out-File -Path (Join-Path $docsOutputPath '.nojekyll')
7272

73-
$generatedVersionInfo = [xml](Get-Content (Join-Path $buildInfo['RepoRootPath'] 'GeneratedVersion.props'))
74-
$fullBuildNumber = $generatedVersionInfo.Project.PropertyGroup.InformationalVersion
73+
#TODO: Find a way to leverage the build version information programmatically
74+
# One option used in other repos, is to create a dummy project and use the generated
75+
# Properties to save to a JSON file... That's dodgy at best for something so common as this...
76+
# Perhaps this repo could build a .NET tool that used the versioning library itself and that
77+
# could produce the version numbering for use in docs builds. Such use would require tests to
78+
# validate that the behavior of the versioning library matches that of the build task, but it
79+
# should have such testing anyway.
80+
$fullBuildNumber = '<build version unavailable>'
7581

7682
push-location './docfx'
7783
try

Directory.Build.props

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
<Project>
2-
<PropertyGroup>
3-
<GeneratedVersionProps>$(MSBuildThisFileDirectory)GeneratedVersion.props</GeneratedVersionProps>
4-
</PropertyGroup>
5-
<!--
6-
Import the generated version information for this build; Projects in this repo cannot use themselves
7-
to generate the version information. Tests VALIDATE that the actual built packages do contain
8-
expected values though so the duplication of computing the versioning is verified to produce the same
9-
results, at least for the packages tested. The existence is tested again in the targets file and reported
10-
as an error if not present.
11-
-->
12-
<Import Condition="Exists('$(GeneratedVersionProps)')" Project="$(GeneratedVersionProps)" />
13-
142
<!--
153
Description:
164
This property file is imported by the projects in this repository to set global locations
@@ -77,7 +65,7 @@
7765
<ImplicitUsings>disable</ImplicitUsings>
7866
<!-- NOTE: Top-Level statements blocked as an error in .editorconfig and ImplicitUsings 'feature' VERIFIED in the targets file -->
7967
</PropertyGroup>
80-
<ItemGroup Condition="'$(UseStyleCop)'=='true'">
68+
<ItemGroup Condition="'$(UseStyleCop)' != 'false'">
8169
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
8270
</ItemGroup>
8371
</When>

Directory.Build.targets

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,15 @@
4040
-->
4141
<Error Condition="'$(ImplicitUsings)'!='disable'" Code="REPO001" Text="$(MSBuildProjectFile) - Projects in this repository MUST NOT have ImplicitUsings enabled!"/>
4242

43-
<!--Verify that GeneratedVersion.props exists; and produce a, hopefully, informative message on how to create it if it doesn't -->
44-
<Error Condition="!Exists('$(GeneratedVersionProps)')" Code="REPO002" Text="$(GeneratedVersionProps) file does not exist, it must be created by `New-GeneratedBersionProps.ps1` BEFORE building in the IDE for consistent results"/>
43+
<!--
44+
Until issue https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3902 is resolved this directly test for the missing stylecop.json file.
45+
Given that was opened nearly a year ago and that it went 2 months to even get a comment about the cause, it seems unlikely that will receive a
46+
fix any time soon...
47+
-->
48+
<Error Code="REPO002" Condition="!Exists('$(MSBuildThisFileDirectory)stylecop.json')" Text="Missing StyleCop.Json file!"/>
49+
50+
<!--
51+
Additional Repo specific checks go here...
52+
-->
4553
</Target>
4654
</Project>

Directory.Packages.props

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,25 @@
44
Global references are included in ALL projects in this repository
55
-->
66
<ItemGroup>
7+
<GlobalPackageReference Include="Ubiquity.NET.Versioning.Build.Tasks" Version="5.0.4"/>
8+
79
<!--
8-
NOTE: This analyzer is sadly, perpetually in "pre-release mode". There have been many issues/discussion on the point
9-
and it has all fallen on deaf ears. So policies regarding "NO-Prerelease" components need to be overruled on this one
10+
NOTE: This analyzer is sadly, perpetually in "pre-release" mode. There have been many issues/discussion on the point
11+
and it has not changed official plans for the library. So policies regarding "NO-Prerelease" components need to be
12+
overruled on this one
1013
-->
1114
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" Condition="'$(UseStyleCop)' != 'false'" />
1215
</ItemGroup>
16+
1317
<!--
1418
Package versions made consistent across all packages referenced in this repository
1519
-->
1620
<ItemGroup>
17-
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="6.0.0" />
18-
<PackageVersion Include="Microsoft.Build.Framework" Version="17.14.8" />
19-
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.14.8" />
20-
<PackageVersion Include="MSBuild.ProjectCreation" Version="14.0.5" />
21+
<PackageVersion Include="Sprache" Version="2.3.1" />
22+
2123
<!-- Tests all use the same framework versions -->
2224
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.0" />
2325
<PackageVersion Include="MSTest.TestAdapter" Version="3.9.1" />
2426
<PackageVersion Include="MSTest.TestFramework" Version="3.9.1" />
25-
<PackageVersion Include="Polyfill" Version="7.31.0" />
26-
<PackageVersion Include="Sprache" Version="2.3.1" />
27-
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
2827
</ItemGroup>
29-
</Project>
28+
</Project>

IgnoredWords.dic

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ depersist
5858
dllimport
5959
docfx
6060
docfxconsole
61+
dodgy
6162
dotnet
6263
endianess
6364
endianness
@@ -123,6 +124,7 @@ refactor
123124
refcount
124125
repl
125126
repo
127+
repos
126128
RMW
127129
runtimes
128130
RValue

PsModules/CommonBuild/Public/Show-FullBuildInfo.ps1

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,4 @@ function Show-FullBuildInfo
3131

3232
Write-Verbose ".NET SDKs:"
3333
Write-Verbose (dotnet --list-sdks | Out-String)
34-
Write-Verbose "GITHUB vars"
35-
Write-Verbose (dir env:GITHUB* | Format-Table -Property Name, value | Out-String)
3634
}

PsModules/RepoBuild/Debug-Module.ps1

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,3 @@ Import-Module $PSScriptRoot\RepoBuild.psd1 -Force -Verbose
66
# this eliminates most of the error prone tedious nature of manual updates.
77
RepoBuild\Get-FunctionsToExport
88

9-
# This is private and should not be exported - Should generate an error
10-
$buildInfo = @{
11-
BuildOutputPath = 'foo/bar'
12-
LlvmRoot = 'foo/bar/llvm-project/llvm'
13-
}
14-
15-
$config = New-LLvmCmakeConfig "x64-Release" ARM "release" $buildInfo
16-
if(!$config -or $config -isnot [hashtable])
17-
{
18-
throw "Null or wrong type returned!"
19-
}

PsModules/RepoBuild/Public/Initialize-BuildEnvironment.ps1

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,10 @@ function Initialize-BuildEnvironment
4747
{
4848
# use common repo-neutral function to perform most of the initialization
4949
$buildInfo = Initialize-CommonBuildEnvironment $repoRoot -FullInit:$FullInit
50-
if($IsWindows -and !(Find-OnPath MSBuild))
51-
{
52-
Write-Information "Adding MSBUILD to PATH"
53-
$env:PATH += ";$(vswhere -find MSBuild\Current\Bin\MSBuild.exe | split-path -parent)"
54-
}
55-
56-
if(!(Find-OnPath MSBuild))
57-
{
58-
throw "MSBuild not found - currently required for LIBLLVM builds"
59-
}
60-
61-
# Add repo specific values
62-
$buildInfo['PackagesRoot'] = Join-Path $buildInfo['BuildOutputPath'] 'packages'
63-
$buildInfo['OfficialGitRemoteUrl'] = 'https://github.com/UbiquityDotNET/CSemVer.GitBuild.git'
50+
$buildInfo['OfficialGitRemoteUrl'] = 'https://github.com/UbiquityDotNET/Ubiquity.NET.Versioning.git'
6451

6552
# make sure directories required (but not created by build tools) exist
6653
New-Item -ItemType Directory -Path $buildInfo['BuildOutputPath'] -ErrorAction SilentlyContinue | Out-Null
67-
New-Item -ItemType Directory -Path $buildInfo['PackagesRoot'] -ErrorAction SilentlyContinue | Out-Null
6854
New-Item -ItemType Directory $buildInfo['NuGetOutputPath'] -ErrorAction SilentlyContinue | Out-Null
6955

7056
return $buildInfo

PsModules/RepoBuild/RepoBuild.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ CompanyName = 'Ubquity.NET'
1818
Copyright = '(c) 2020-2025 Ubiquity.NET Contributors. All rights reserved.'
1919

2020
# Description of the functionality provided by this module
21-
Description = 'Repository build support functions for Ubiquity.NET.LlvmLibs'
21+
Description = 'Repository build support functions for Ubiquity.NET.Versioning library'
2222

2323
# Minimum version of the Windows PowerShell engine required by this module
2424
PowerShellVersion = '7.0'

0 commit comments

Comments
 (0)