From: Owen Smith Date: Tue, 10 Mar 2020 10:47:03 +0000 (+0000) Subject: Handle return codes from MSBuild X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2ff3d8163932a27e32a4bb1e9708e6a53aa0ed33;p=pvdrivers%2Fwin%2Fxenvif.git Handle return codes from MSBuild If MSBuild fails, it returns a non-zero return value. Forward this failure to the calling scripts to fail earlier. Signed-off-by: Owen Smith --- diff --git a/build.ps1 b/build.ps1 index 859d5cd..4c76969 100644 --- a/build.ps1 +++ b/build.ps1 @@ -29,6 +29,10 @@ Function Build { Type = $Type } & ".\msbuild.ps1" @params + if ($LASTEXITCODE -ne 0) { + Write-Host -ForegroundColor Red "ERROR: Build failed, code:" $LASTEXITCODE + Exit $LASTEXITCODE + } } Function SdvBuild { diff --git a/msbuild.ps1 b/msbuild.ps1 index 592484e..2e6e8a0 100644 --- a/msbuild.ps1 +++ b/msbuild.ps1 @@ -31,6 +31,10 @@ Function Run-MSBuild { $c += Join-Path -Path $SolutionPath -ChildPath $Name Invoke-Expression $c + if ($LASTEXITCODE -ne 0) { + Write-Host -ForegroundColor Red "ERROR: MSBuild failed, code:" $LASTEXITCODE + Exit $LASTEXITCODE + } } Function Run-MSBuildSDV {