Skip to content

Commit 6324226

Browse files
committed
return a non-0 exit code when one or more builds failed
1 parent 14d31ae commit 6324226

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Libraries/Build.ps1

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Push-Location $PSScriptRoot
22
. .\Settings.ps1
33

4+
$anyError = $False
5+
46
ForEach ($p in $client_projects) {
57
ForEach ($b in $client_build_configurations) {
68
$isPclClient = ($($p.Name) -eq "Exceptionless.Portable") -or ($($p.Name) -eq "Exceptionless.Portable.Signed")
@@ -49,6 +51,9 @@ ForEach ($p in $client_projects) {
4951
/p:TargetFrameworkVersionProperty="$($b.TargetFrameworkVersionProperty)" `
5052
/t:"Rebuild"
5153
}
54+
If (-not $?) {
55+
$anyError = $True
56+
}
5257

5358
Write-Host "Finished building $($p.Name) ($($b.TargetFrameworkVersionProperty))" -ForegroundColor Yellow
5459
}
@@ -66,7 +71,13 @@ msbuild "$source_dir\Tests\Exceptionless.Tests.csproj" `
6671
/p:TargetFrameworkVersionProperty="NET40" `
6772
/p:TargetFrameworkProfile="" `
6873
/p:TargetPortable="false"
69-
74+
If (-not $?) {
75+
$anyError = $True
76+
}
7077
Write-Host "Finished building Client Tests" -ForegroundColor Yellow
7178

72-
Pop-Location
79+
Pop-Location
80+
81+
If ($anyError) {
82+
exit 1
83+
}

0 commit comments

Comments
 (0)