]> xenbits.xensource.com Git - pvdrivers/win/xenhid.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:39:09 +0000 (15:39 +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 80dbc251e663dc50256eeb9ca24b686dd572de5a..9edd87fd2d4649dcfe12c7350828335c78519852 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 {