Fix parameter parsing for run-build, and report better stack trace on failures

This commit is contained in:
Daniel Plaisted 2018-12-04 13:20:01 -08:00
parent d8b55a5561
commit 77b34b17c0

View file

@ -3,6 +3,7 @@
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
[CmdletBinding(PositionalBinding=$false)]
param(
[string]$Configuration="Debug",
[string]$Architecture="x64",
@ -13,6 +14,15 @@ $RepoRoot = "$PSScriptRoot"
$ArchitectureParam="/p:Architecture=$Architecture"
$ConfigurationParam="-configuration $Configuration"
try {
$ExpressionToInvoke = "$RepoRoot\eng\common\build.ps1 -restore -build $ConfigurationParam $ArchitectureParam $ExtraParameters"
Write-Host "Invoking expression: $ExpressionToInvoke"
Invoke-Expression $ExpressionToInvoke
}
catch {
Write-Error $_
Write-Error $_.ScriptStackTrace
throw "Failed to build"
}
Invoke-Expression "$RepoRoot\eng\common\build.ps1 -restore -build $ConfigurationParam $ArchitectureParam $ExtraParameters"
if($LASTEXITCODE -ne 0) { throw "Failed to build" }