diff options
| author | Adonais Romero González <[email protected]> | 2022-09-06 16:36:33 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-09-06 16:36:33 -0700 |
| commit | 110e8c201d5a929fc01e333ceac0dc71b0267237 (patch) | |
| tree | ad236c3bcd9cdca7511753950ea60db417160d56 /Build-ProjectSet.ps1 | |
| parent | d504c54cf595e9185617a3e611e417617be8c0b8 (diff) | |
Miscellaneous build scripts fixes (#779)
Fix actions: escape emoji characters; add small validations to build scripts
Diffstat (limited to 'Build-ProjectSet.ps1')
| -rw-r--r-- | Build-ProjectSet.ps1 | 31 |
1 files changed, 29 insertions, 2 deletions
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 |
