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=5fc71e42ee12afe3edf7c2607a8c50cad31154f8;p=pvdrivers%2Fwin%2Fxencons.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 cc352e0..c66ac05 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 bf15af8..97e1292 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 {