From 110e8c201d5a929fc01e333ceac0dc71b0267237 Mon Sep 17 00:00:00 2001 From: Adonais Romero González Date: Tue, 6 Sep 2022 16:36:33 -0700 Subject: Miscellaneous build scripts fixes (#779) Fix actions: escape emoji characters; add small validations to build scripts --- Build-ProjectSet.ps1 | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'Build-ProjectSet.ps1') diff --git a/Build-ProjectSet.ps1 b/Build-ProjectSet.ps1 index 57c4ac32..2557b5b9 100644 --- a/Build-ProjectSet.ps1 +++ b/Build-ProjectSet.ps1 @@ -4,7 +4,34 @@ param( [string]$Platform = $env:Platform ) -#TODO validate params +if ([string]::IsNullOrEmpty($Configuration)) +{ + $Configuration = "Debug" +} + +if ([string]::IsNullOrEmpty($Platform)) +{ + $Platform = "x64" +} + +$oldPreference = $ErrorActionPreference +$ErrorActionPreference = "stop" +try +{ + # Check that msbuild can be called before trying anything. + Get-Command "msbuild" | Out-Null +} +catch +{ + Write-Host "`u{274C} msbuild cannot be called from current environment. Check that msbuild is set in current path (for example, that it is called from a Visual Studio developer command)." + Write-Error "msbuild cannot be called from current environment." + exit 1 +} +finally +{ + $ErrorActionPreference = $oldPreference +} + $exclusionsSet = @{} $failSet = @() @@ -16,7 +43,7 @@ $ProjectSet.GetEnumerator() | ForEach-Object { $projectName = $_.Key if ($exclusionsSet.ContainsKey($projectName)) { - Write-Output "[$projectName] ⏩ Excluded and skipped. Reason: $($exclusionsSet[$projectName])" + Write-Output "[$projectName] `u{23E9} Excluded and skipped. Reason: $($exclusionsSet[$projectName])" return; } $directory = $_.Value -- cgit v1.3.1