From 77b34b17c0ca2540a7d48ffcd0ebfa7a440ee225 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Tue, 4 Dec 2018 13:20:01 -0800 Subject: [PATCH] Fix parameter parsing for run-build, and report better stack trace on failures --- run-build.ps1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/run-build.ps1 b/run-build.ps1 index 6f2166b44..ebdf0fdf5 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -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" } \ No newline at end of file