mirror of
https://github.com/actions/runner-images.git
synced 2025-12-20 06:35:47 +00:00
[macOS] Set Visual Studio 2022 for Mac by default (#5614)
* Set Visual Studio 2022 for Mac by default * add isDefault
This commit is contained in:
committed by
GitHub
parent
bf4c35eee5
commit
1d519b89d7
@@ -1,13 +1,26 @@
|
||||
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
||||
|
||||
function Get-VSMac2019Version {
|
||||
$plistPath = "/Applications/Visual Studio.app/Contents/Info.plist"
|
||||
return Run-Command "/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' '$plistPath'"
|
||||
}
|
||||
function Build-VSMacTable {
|
||||
$vsMacVersions = Get-ToolsetValue "xamarin.vsmac.versions"
|
||||
$defaultVSMacVersion = Get-ToolsetValue "xamarin.vsmac.default"
|
||||
|
||||
function Get-VSMac2022Version {
|
||||
$plistPath = "/Applications/Visual Studio Preview.app/Contents/Info.plist"
|
||||
return Run-Command "/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' '$plistPath'"
|
||||
$vsMacVersions | ForEach-Object {
|
||||
$isDefault = $_ -eq $defaultVSMacVersion
|
||||
$vsPath = "/Applications/Visual Studio $_.app"
|
||||
if ($isDefault) {
|
||||
$vsPath = "/Applications/Visual Studio.app"
|
||||
}
|
||||
|
||||
$plistPath = "$vsPath/Contents/Info.plist"
|
||||
$build = Run-Command "/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' '$plistPath'"
|
||||
$defaultPostfix = $isDefault ? " (default)" : ""
|
||||
|
||||
[PSCustomObject] @{
|
||||
"Version" = $_ + $defaultPostfix
|
||||
"Build" = $build
|
||||
"Path" = $vsPath
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Get-NUnitVersion {
|
||||
@@ -33,4 +46,3 @@ function Build-XamarinTable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user