]> xenbits.xensource.com Git - pvdrivers/win/xennet.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:08 +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 dd1bd25ba3a609853081a738a21b3ebb5138b505..d1980a42e7aea40ba9487f050aaa149a4c396258 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 52856670ff2404f78f6de83ab1d826be500d0321..d9f829453972503ce7b05aa34df52deba7b4d762 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 {