]> xenbits.xensource.com Git - pvdrivers/win/xencons.git/commitdiff
Handle return codes from MSBuild
authorOwen Smith <owen.smith@citrix.com>
Tue, 10 Mar 2020 10:47:03 +0000 (10:47 +0000)
committerPaul Durrant <paul@xen.org>
Tue, 10 Mar 2020 15:38:48 +0000 (15:38 +0000)
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 <owen.smith@citrix.com>
build.ps1
msbuild.ps1

index cc352e06bfea2f2eb22d115f07863bcfaefbc96b..c66ac056b8dc026871ed1ab468304eb13b8d6079 100644 (file)
--- 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 {
index bf15af8f3852364b141604034e984f8ba934b9ef..97e1292bb0c3533b74c5153961620c12b1eed23c 100644 (file)
@@ -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 {