Skip to content

Commit

Permalink
Fix build script
Browse files Browse the repository at this point in the history
Removes NuGet workaround for pre-2.0 and lines up with other script
enhancements since.
  • Loading branch information
Nick Craver committed Sep 14, 2017
1 parent e2ebdb0 commit d45b79f
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ function CalculateVersion() {
return "$semVersion-$BuildNumber"
}

if ($BuildNumber -and $BuildNumber.Length -lt 5) {
$BuildNumber = $BuildNumber.PadLeft(5, "0")
}

Write-Host "Run Parameters:" -ForegroundColor Cyan
Write-Host "Version: $Version"
Write-Host "BuildNumber: $BuildNumber"
Expand Down Expand Up @@ -70,7 +74,7 @@ if ($RunTests) {
dotnet restore /ConsoleLoggerParameters:Verbosity=Quiet
foreach ($project in $testsToRun) {
Write-Host "Running tests: $project (all frameworks)" -ForegroundColor "Magenta"
Push-Location "$project"
Push-Location ".\$project"

dotnet xunit
if ($LastExitCode -ne 0) {
Expand Down Expand Up @@ -99,17 +103,19 @@ foreach ($project in $projectsToBuild) {
Push-Location ".\$project"

$semVer = CalculateVersion

Write-Host " Restoring and packing $project... (Version:" -NoNewline -ForegroundColor "Magenta"
Write-Host $semVer -NoNewline -ForegroundColor "Cyan"
Write-Host ")" -ForegroundColor "Magenta"

$targets = "Restore"

Write-Host " Restoring " -NoNewline -ForegroundColor "Magenta"
if ($CreatePackages) {
$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

Expand Down

0 comments on commit d45b79f

Please sign in to comment.