Skip to content

Commit 24c08ec

Browse files
committed
🔧 Enable deterministic builds
1 parent 50f510a commit 24c08ec

File tree

3 files changed

+27
-105
lines changed

3 files changed

+27
-105
lines changed

Build/build-functions.psm1

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function Start-Build([boolean] $IncludeNanoFramework = $false) {
3737
$appVeyorLoggerNetCoreDll = "C:\Program Files\AppVeyor\BuildAgent\dotnetcore\Appveyor.MSBuildLogger.dll"
3838
$appVeyorLoggerArg = if (Test-Path "$appVeyorLoggerNetCoreDll") { "/logger:$appVeyorLoggerNetCoreDll" } else { "" }
3939

40-
dotnet build --configuration Release "$root\UnitsNet.sln" $fileLoggerArg $appVeyorLoggerArg
40+
dotnet build --configuration Release /p:ContinuousIntegrationBuild=true "$root\UnitsNet.sln" $fileLoggerArg $appVeyorLoggerArg
4141
if ($lastexitcode -ne 0) { exit 1 }
4242

4343
if (-not $IncludeNanoFramework)
@@ -53,7 +53,7 @@ function Start-Build([boolean] $IncludeNanoFramework = $false) {
5353
# msbuild does not auto-restore nugets for this project type
5454
& "$nuget" restore "$root\UnitsNet.NanoFramework\GeneratedCode\UnitsNet.nanoFramework.sln"
5555
# now build
56-
& "$msbuildx64" "$root\UnitsNet.NanoFramework\GeneratedCode\UnitsNet.nanoFramework.sln" /verbosity:minimal /p:Configuration=Release /p:Platform="Any CPU" $fileLoggerArg $appVeyorLoggerArg
56+
& "$msbuildx64" "$root\UnitsNet.NanoFramework\GeneratedCode\UnitsNet.nanoFramework.sln" /verbosity:minimal /p:Configuration=Release /p:Platform="Any CPU" /p:ContinuousIntegrationBuild=true $fileLoggerArg $appVeyorLoggerArg
5757
if ($lastexitcode -ne 0) { exit 1 }
5858
}
5959

@@ -83,6 +83,7 @@ function Start-Tests {
8383

8484
# Create coverage report for this test project
8585
& dotnet dotcover test `
86+
--no-build `
8687
--dotCoverFilters="+:module=UnitsNet*;-:module=*Tests" `
8788
--dotCoverOutput="$coverageReportFile" `
8889
--dcReportType=DetailedXML
@@ -106,7 +107,12 @@ function Start-PackNugets([boolean] $IncludeNanoFramework = $false) {
106107

107108
write-host -foreground blue "Pack nugets...`n---"
108109
foreach ($projectPath in $projectPaths) {
109-
dotnet pack --configuration Release -o $nugetOutDir "$root\$projectPath"
110+
dotnet pack --configuration Release `
111+
--no-build `
112+
--output $nugetOutDir `
113+
/p:ContinuousIntegrationBuild=true `
114+
"$root\$projectPath"
115+
110116
if ($lastexitcode -ne 0) { exit 1 }
111117
}
112118

UnitsNet.sln

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ ProjectSection(SolutionItems) = preProject
2424
.editorconfig = .editorconfig
2525
.gitattributes = .gitattributes
2626
.gitignore = .gitignore
27-
appveyor.yml = appveyor.yml
2827
build.bat = build.bat
2928
build-all-targets.bat = build-all-targets.bat
3029
clean.bat = clean.bat
@@ -40,8 +39,19 @@ ProjectSection(SolutionItems) = preProject
4039
test.bat = test.bat
4140
UnitsNet.sln.DotSettings = UnitsNet.sln.DotSettings
4241
UnitsNet.snk = UnitsNet.snk
42+
azure-pipelines.yml = azure-pipelines.yml
4343
EndProjectSection
4444
EndProject
45+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{C315CD54-43F9-47CB-8125-04036D6B5BF0}"
46+
EndProject
47+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{71C6EF60-7E52-4DF4-BA93-5FAF6D89AEC6}"
48+
ProjectSection(SolutionItems) = preProject
49+
Build\build.ps1 = Build\build.ps1
50+
Build\build-functions.psm1 = Build\build-functions.psm1
51+
Build\build-pack-nano-nugets.psm1 = Build\build-pack-nano-nugets.psm1
52+
Build\init.ps1 = Build\init.ps1
53+
EndProjectSection
54+
EndProject
4555
Global
4656
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4757
Debug|Any CPU = Debug|Any CPU
@@ -80,11 +90,18 @@ Global
8090
{B4996AF5-9A8B-481A-9018-EC7F5B1605FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
8191
{B4996AF5-9A8B-481A-9018-EC7F5B1605FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
8292
{B4996AF5-9A8B-481A-9018-EC7F5B1605FF}.Release|Any CPU.Build.0 = Release|Any CPU
93+
{C315CD54-43F9-47CB-8125-04036D6B5BF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
94+
{C315CD54-43F9-47CB-8125-04036D6B5BF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
95+
{C315CD54-43F9-47CB-8125-04036D6B5BF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
96+
{C315CD54-43F9-47CB-8125-04036D6B5BF0}.Release|Any CPU.Build.0 = Release|Any CPU
8397
EndGlobalSection
8498
GlobalSection(SolutionProperties) = preSolution
8599
HideSolutionNode = FALSE
86100
EndGlobalSection
87101
GlobalSection(ExtensibilityGlobals) = postSolution
88102
SolutionGuid = {554906B2-5972-4EBF-9DD5-EEFA77D735D8}
89103
EndGlobalSection
104+
GlobalSection(NestedProjects) = preSolution
105+
{71C6EF60-7E52-4DF4-BA93-5FAF6D89AEC6} = {B92B01BE-243E-4CCB-B5E5-AF469ADB1F54}
106+
EndGlobalSection
90107
EndGlobal

appveyor.yml

Lines changed: 0 additions & 101 deletions
This file was deleted.

0 commit comments

Comments
 (0)