check for msbuild so we know if we need to load the vs environment # Description Fixes build_rive.ps1 so that it no longer eventually breaks PATH # Details added a check that only loads the VS environment when `msbuild` is not found <!-- Questions before merging: - If this is a feature, is it sufficiently unit tested? - If this fixes a bug, is there a unit test to ensure no regression? - Does this concern Marketing, and could we make an announcement about it? - If so, now is the time to notify them - Are the commits in [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) format? - This will help with automated release notes --> Diffs= 762485768a check for msbuild so we know if we need to load the vs environment (#9374) Co-authored-by: Jonathon Copeland <jcopela4@gmail.com>
diff --git a/.rive_head b/.rive_head index 61930f2..c30a774 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -85cdb3102268b73e0329ff8cba7c2ee8298f1939 +762485768ad11846fec2347a7ffc24fc071e9f03
diff --git a/build/build_rive.ps1 b/build/build_rive.ps1 index b223f9c..b7f4b65 100644 --- a/build/build_rive.ps1 +++ b/build/build_rive.ps1
@@ -1,14 +1,18 @@ # requires Set-ExecutionPolicy Bypass -Scope CurrentUser $CWD = Get-Location -if (Test-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1" -PathType Leaf) { - & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1" -} else { - if ("C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\Launch-VsDevShell.ps1") { - & 'C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\Launch-VsDevShell.ps1' - } - else { - Write-Error "Visual Studio 2022 does not appear to be installed, please install visual studio to C:\Program Files\Microsoft Visual Studio" - exit +if (Get-Command -Name "msbuild" -ErrorAction SilentlyContinue){} +else +{ + if (Test-Path "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1" -PathType Leaf) { + & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1" + } else { + if ("C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\Launch-VsDevShell.ps1") { + & 'C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\Tools\Launch-VsDevShell.ps1' + } + else { + Write-Error "Visual Studio 2022 does not appear to be installed, please install visual studio to C:\Program Files\Microsoft Visual Studio" + exit + } } } Set-Location $CWD