Skip to content

Commit 2f93f43

Browse files
committed
Fix build failure on empty version suffix
1 parent 883422f commit 2f93f43

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Build.ps1

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
$versionSuffix="pre"
2+
13
function VerifySuccessExitCode {
24
if ($LastExitCode -ne 0) {
35
throw "Command failed with exit code $LastExitCode."
@@ -6,11 +8,12 @@ function VerifySuccessExitCode {
68

79
Write-Host "$(pwsh --version)"
810
Write-Host "Active .NET SDK: $(dotnet --version)"
11+
Write-Host "Using version suffix: $versionSuffix"
912

1013
dotnet tool restore
1114
VerifySuccessExitCode
1215

13-
dotnet build --configuration Release --version-suffix="pre"
16+
dotnet build --configuration Release /p:VersionSuffix=$versionSuffix
1417
VerifySuccessExitCode
1518

1619
dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.DeterministicReport=true
@@ -19,5 +22,5 @@ VerifySuccessExitCode
1922
dotnet reportgenerator -reports:**\coverage.cobertura.xml -targetdir:artifacts\coverage -filefilters:-*.g.cs
2023
VerifySuccessExitCode
2124

22-
dotnet pack --no-build --configuration Release --output artifacts/packages --version-suffix="pre"
25+
dotnet pack --no-build --configuration Release --output artifacts/packages /p:VersionSuffix=$versionSuffix
2326
VerifySuccessExitCode

0 commit comments

Comments
 (0)