Skip to content

Commit

Permalink
🔧 Enable deterministic builds
Browse files Browse the repository at this point in the history
  • Loading branch information
angularsen committed Dec 26, 2022
1 parent 50f510a commit 24c08ec
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 105 deletions.
12 changes: 9 additions & 3 deletions Build/build-functions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function Start-Build([boolean] $IncludeNanoFramework = $false) {
$appVeyorLoggerNetCoreDll = "C:\Program Files\AppVeyor\BuildAgent\dotnetcore\Appveyor.MSBuildLogger.dll"
$appVeyorLoggerArg = if (Test-Path "$appVeyorLoggerNetCoreDll") { "/logger:$appVeyorLoggerNetCoreDll" } else { "" }

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

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

Expand Down Expand Up @@ -83,6 +83,7 @@ function Start-Tests {

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

write-host -foreground blue "Pack nugets...`n---"
foreach ($projectPath in $projectPaths) {
dotnet pack --configuration Release -o $nugetOutDir "$root\$projectPath"
dotnet pack --configuration Release `
--no-build `
--output $nugetOutDir `
/p:ContinuousIntegrationBuild=true `
"$root\$projectPath"

if ($lastexitcode -ne 0) { exit 1 }
}

Expand Down
19 changes: 18 additions & 1 deletion UnitsNet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitattributes = .gitattributes
.gitignore = .gitignore
appveyor.yml = appveyor.yml
build.bat = build.bat
build-all-targets.bat = build-all-targets.bat
clean.bat = clean.bat
Expand All @@ -40,8 +39,19 @@ ProjectSection(SolutionItems) = preProject
test.bat = test.bat
UnitsNet.sln.DotSettings = UnitsNet.sln.DotSettings
UnitsNet.snk = UnitsNet.snk
azure-pipelines.yml = azure-pipelines.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{C315CD54-43F9-47CB-8125-04036D6B5BF0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{71C6EF60-7E52-4DF4-BA93-5FAF6D89AEC6}"
ProjectSection(SolutionItems) = preProject
Build\build.ps1 = Build\build.ps1
Build\build-functions.psm1 = Build\build-functions.psm1
Build\build-pack-nano-nugets.psm1 = Build\build-pack-nano-nugets.psm1
Build\init.ps1 = Build\init.ps1
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -80,11 +90,18 @@ Global
{B4996AF5-9A8B-481A-9018-EC7F5B1605FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B4996AF5-9A8B-481A-9018-EC7F5B1605FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B4996AF5-9A8B-481A-9018-EC7F5B1605FF}.Release|Any CPU.Build.0 = Release|Any CPU
{C315CD54-43F9-47CB-8125-04036D6B5BF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C315CD54-43F9-47CB-8125-04036D6B5BF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C315CD54-43F9-47CB-8125-04036D6B5BF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C315CD54-43F9-47CB-8125-04036D6B5BF0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {554906B2-5972-4EBF-9DD5-EEFA77D735D8}
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{71C6EF60-7E52-4DF4-BA93-5FAF6D89AEC6} = {B92B01BE-243E-4CCB-B5E5-AF469ADB1F54}
EndGlobalSection
EndGlobal
101 changes: 0 additions & 101 deletions appveyor.yml

This file was deleted.

0 comments on commit 24c08ec

Please sign in to comment.