[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:
Aleksandr Chebotov
2022-05-26 17:05:57 +02:00
committed by GitHub
parent bf4c35eee5
commit 1d519b89d7
7 changed files with 62 additions and 33 deletions

View File

@@ -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 {
}
}
}