[macOS] Add VSForMac 2022 Preview (#5561)
This commit is contained in:
@@ -2,28 +2,47 @@
|
|||||||
source ~/utils/utils.sh
|
source ~/utils/utils.sh
|
||||||
source ~/utils/xamarin-utils.sh
|
source ~/utils/xamarin-utils.sh
|
||||||
|
|
||||||
VSMAC_VERSION=$(get_toolset_value '.xamarin.vsmac')
|
install_vsmac() {
|
||||||
if [ $VSMAC_VERSION == "latest" ]; then
|
local VSMAC_VERSION=$1
|
||||||
VSMAC_VERSION=$(curl -L "http://aka.ms/manifest/stable" | jq -r ".items[] | select(.genericName==\"VisualStudioMac\").version")
|
if [ $VSMAC_VERSION == "latest" ]; then
|
||||||
|
VSMAC_DOWNLOAD_URL=$(curl -sL "https://aka.ms/manifest/stable" | jq -r '.items[] | select(.genericName=="VisualStudioMac").url')
|
||||||
|
elif [ $VSMAC_VERSION == "preview" ]; then
|
||||||
|
VSMAC_DOWNLOAD_URL=$(curl -sL "https://aka.ms/manifest/preview" | jq -r '.items[] | select(.genericName=="VisualStudioMac").url')
|
||||||
|
else
|
||||||
|
VSMAC_DOWNLOAD_URL=$(buildVSMacDownloadUrl $VSMAC_VERSION)
|
||||||
|
fi
|
||||||
|
|
||||||
|
TMPMOUNT=`/usr/bin/mktemp -d /tmp/visualstudio.XXXX`
|
||||||
|
TMPMOUNT_DOWNLOADS="$TMPMOUNT/downloads"
|
||||||
|
mkdir $TMPMOUNT_DOWNLOADS
|
||||||
|
|
||||||
|
download_with_retries $VSMAC_DOWNLOAD_URL $TMPMOUNT_DOWNLOADS
|
||||||
|
|
||||||
|
echo "Mounting Visual Studio..."
|
||||||
|
VISUAL_STUDIO_NAME=${VSMAC_DOWNLOAD_URL##*/}
|
||||||
|
hdiutil attach "$TMPMOUNT_DOWNLOADS/$VISUAL_STUDIO_NAME" -mountpoint "$TMPMOUNT"
|
||||||
|
|
||||||
|
echo "Moving Visual Studio to /Applications/..."
|
||||||
|
pushd $TMPMOUNT
|
||||||
|
tar cf - "./Visual Studio.app" | tar xf - -C /Applications/
|
||||||
|
|
||||||
|
if [ $VSMAC_VERSION == "preview" ]; then
|
||||||
|
mv "/Applications/Visual Studio.app" "/Applications/Visual Studio Preview.app"
|
||||||
|
fi
|
||||||
|
|
||||||
|
popd
|
||||||
|
sudo hdiutil detach "$TMPMOUNT"
|
||||||
|
sudo rm -rf "$TMPMOUNT"
|
||||||
|
}
|
||||||
|
|
||||||
|
VSMAC_VERSION_PREVIEW=$(get_toolset_value '.xamarin.vsmac_preview')
|
||||||
|
if [ $VSMAC_VERSION_PREVIEW != "null" ];then
|
||||||
|
echo "Installing Visual Studio 2022 for Mac Preview"
|
||||||
|
install_vsmac $VSMAC_VERSION_PREVIEW
|
||||||
fi
|
fi
|
||||||
VSMAC_DOWNLOAD_URL=$(buildVSMacDownloadUrl $VSMAC_VERSION)
|
|
||||||
|
|
||||||
TMPMOUNT=`/usr/bin/mktemp -d /tmp/visualstudio.XXXX`
|
echo "Installing Visual Studio 2019 for Mac Stable"
|
||||||
TMPMOUNT_DOWNLOADS="$TMPMOUNT/downloads"
|
VSMAC_VERSION_STABLE=$(get_toolset_value '.xamarin.vsmac')
|
||||||
mkdir $TMPMOUNT_DOWNLOADS
|
install_vsmac $VSMAC_VERSION_STABLE
|
||||||
|
|
||||||
download_with_retries $VSMAC_DOWNLOAD_URL $TMPMOUNT_DOWNLOADS
|
|
||||||
|
|
||||||
echo "Mounting Visual studio..."
|
|
||||||
VISUAL_STUDIO_NAME=${VSMAC_DOWNLOAD_URL##*/}
|
|
||||||
hdiutil attach "$TMPMOUNT_DOWNLOADS/$VISUAL_STUDIO_NAME" -mountpoint "$TMPMOUNT"
|
|
||||||
|
|
||||||
echo "Moving Visual Studio to /Applications/..."
|
|
||||||
pushd $TMPMOUNT
|
|
||||||
tar cf - "./Visual Studio.app" | tar xf - -C /Applications/
|
|
||||||
|
|
||||||
popd
|
|
||||||
sudo hdiutil detach "$TMPMOUNT"
|
|
||||||
sudo rm -rf "$TMPMOUNT"
|
|
||||||
|
|
||||||
invoke_tests "Common" "VSMac"
|
invoke_tests "Common" "VSMac"
|
||||||
|
|||||||
@@ -242,8 +242,12 @@ $markdown += Build-WebServersSection
|
|||||||
|
|
||||||
# Xamarin section
|
# Xamarin section
|
||||||
$markdown += New-MDHeader "Xamarin" -Level 3
|
$markdown += New-MDHeader "Xamarin" -Level 3
|
||||||
$markdown += New-MDHeader "Visual Studio for Mac" -Level 4
|
$markdown += New-MDHeader "Visual Studio 2019 for Mac" -Level 4
|
||||||
$markdown += New-MDList -Lines @(Get-VSMacVersion) -Style Unordered
|
$markdown += New-MDList -Lines @(Get-VSMac2019Version) -Style Unordered
|
||||||
|
if ($os.IsMonterey) {
|
||||||
|
$markdown += New-MDHeader "Visual Studio 2022 for Mac" -Level 4
|
||||||
|
$markdown += New-MDList -Lines @(Get-VSMac2022Version) -Style Unordered
|
||||||
|
}
|
||||||
|
|
||||||
$markdown += New-MDHeader "Xamarin bundles" -Level 4
|
$markdown += New-MDHeader "Xamarin bundles" -Level 4
|
||||||
$markdown += Build-XamarinTable | New-MDTable
|
$markdown += Build-XamarinTable | New-MDTable
|
||||||
|
|||||||
@@ -1,10 +1,15 @@
|
|||||||
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
||||||
|
|
||||||
function Get-VSMacVersion {
|
function Get-VSMac2019Version {
|
||||||
$plistPath = "/Applications/Visual Studio.app/Contents/Info.plist"
|
$plistPath = "/Applications/Visual Studio.app/Contents/Info.plist"
|
||||||
return Run-Command "/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' '$plistPath'"
|
return Run-Command "/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' '$plistPath'"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Get-VSMac2022Version {
|
||||||
|
$plistPath = "/Applications/Visual Studio Preview.app/Contents/Info.plist"
|
||||||
|
return Run-Command "/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' '$plistPath'"
|
||||||
|
}
|
||||||
|
|
||||||
function Get-NUnitVersion {
|
function Get-NUnitVersion {
|
||||||
$version = Run-Command "nunit3-console --version" | Select-Object -First 1 | Take-Part -Part 3
|
$version = Run-Command "nunit3-console --version" | Select-Object -First 1 | Take-Part -Part 3
|
||||||
return "NUnit ${version}"
|
return "NUnit ${version}"
|
||||||
|
|||||||
@@ -85,6 +85,13 @@ Describe "VSMac" {
|
|||||||
$vsPath | Should -Exist
|
$vsPath | Should -Exist
|
||||||
$vstoolPath | Should -Exist
|
$vstoolPath | Should -Exist
|
||||||
}
|
}
|
||||||
|
|
||||||
|
It "VS4Mac Preview is installed" -Skip:(-not $os.IsMonterey) {
|
||||||
|
$vsPath = "/Applications/Visual Studio Preview.app"
|
||||||
|
$vstoolPath = Join-Path $vsPath "Contents/MacOS/vstool"
|
||||||
|
$vsPath | Should -Exist
|
||||||
|
$vstoolPath | Should -Exist
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Describe "Swig" {
|
Describe "Swig" {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
},
|
},
|
||||||
"xamarin": {
|
"xamarin": {
|
||||||
"vsmac": "latest",
|
"vsmac": "latest",
|
||||||
|
"vsmac_preview": "preview",
|
||||||
"mono-versions": [
|
"mono-versions": [
|
||||||
"6.12.0.174"
|
"6.12.0.174"
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user