]> xenbits.xensource.com Git - pvdrivers/win/xenvif.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:37:38 +0000 (15:37 +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 859d5cd47f126b2997616e4febab990ce98194be..4c769692998d7e1fa3cd8d96fa6be71d116b1696 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 592484ec81050d046df965205eef442d64152390..2e6e8a073b78f6f70922ea7d46f45d7743cf2fb3 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 {