Commit d45b79ff authored by Nick Craver's avatar Nick Craver

Fix build script

Removes NuGet workaround for pre-2.0 and lines up with other script
enhancements since.
parent e2ebdb08
...@@ -33,6 +33,10 @@ function CalculateVersion() { ...@@ -33,6 +33,10 @@ function CalculateVersion() {
return "$semVersion-$BuildNumber" return "$semVersion-$BuildNumber"
} }
if ($BuildNumber -and $BuildNumber.Length -lt 5) {
$BuildNumber = $BuildNumber.PadLeft(5, "0")
}
Write-Host "Run Parameters:" -ForegroundColor Cyan Write-Host "Run Parameters:" -ForegroundColor Cyan
Write-Host "Version: $Version" Write-Host "Version: $Version"
Write-Host "BuildNumber: $BuildNumber" Write-Host "BuildNumber: $BuildNumber"
...@@ -70,7 +74,7 @@ if ($RunTests) { ...@@ -70,7 +74,7 @@ if ($RunTests) {
dotnet restore /ConsoleLoggerParameters:Verbosity=Quiet dotnet restore /ConsoleLoggerParameters:Verbosity=Quiet
foreach ($project in $testsToRun) { foreach ($project in $testsToRun) {
Write-Host "Running tests: $project (all frameworks)" -ForegroundColor "Magenta" Write-Host "Running tests: $project (all frameworks)" -ForegroundColor "Magenta"
Push-Location "$project" Push-Location ".\$project"
dotnet xunit dotnet xunit
if ($LastExitCode -ne 0) { if ($LastExitCode -ne 0) {
...@@ -99,17 +103,19 @@ foreach ($project in $projectsToBuild) { ...@@ -99,17 +103,19 @@ foreach ($project in $projectsToBuild) {
Push-Location ".\$project" Push-Location ".\$project"
$semVer = CalculateVersion $semVer = CalculateVersion
Write-Host " Restoring and packing $project... (Version:" -NoNewline -ForegroundColor "Magenta"
Write-Host $semVer -NoNewline -ForegroundColor "Cyan"
Write-Host ")" -ForegroundColor "Magenta"
$targets = "Restore" $targets = "Restore"
Write-Host " Restoring " -NoNewline -ForegroundColor "Magenta"
if ($CreatePackages) { if ($CreatePackages) {
$targets += ";Pack" $targets += ";Pack"
Write-Host "and packing " -NoNewline -ForegroundColor "Magenta"
} }
Write-Host "$project... (Version:" -NoNewline -ForegroundColor "Magenta"
Write-Host $semVer -NoNewline -ForegroundColor "Cyan"
Write-Host ")" -ForegroundColor "Magenta"
dotnet msbuild "/t:$targets" "/p:Configuration=Release" "/p:Version=$semVer" "/p:PackageOutputPath=$packageOutputFolder" "/p:CI=true" "/p:NuGetBuildTasksPackTargets='000'" dotnet msbuild "/t:$targets" "/p:Configuration=Release" "/p:Version=$semVer" "/p:PackageOutputPath=$packageOutputFolder" "/p:CI=true"
Pop-Location Pop-Location
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment