Merge pull request #1739 from maxim-lobanov/v-malob/12beta6

Deprecate Xcode 12 beta 6 on Catalina image
This commit is contained in:
Maxim Lobanov
2020-10-08 10:42:37 +03:00
committed by GitHub
5 changed files with 19 additions and 39 deletions

View File

@@ -46,11 +46,17 @@ function Switch-Xcode {
}
function Test-XcodeStableRelease {
param(
[Parameter(Mandatory)]
param (
[Parameter(ParameterSetName = 'Version')]
[string] $Version,
[Parameter(ParameterSetName = 'Path')]
[string] $XcodeRootPath
)
if ($PSCmdlet.ParameterSetName -eq "Version") {
$XcodeRootPath = Get-XcodeRootPath $Version
}
$licenseInfoPlistPath = Join-Path $XcodeRootPath "Contents" "Resources" "LicenseInfo.plist"
$releaseType = & defaults read $licenseInfoPlistPath "licenseType"
return -not ($releaseType -match "beta")
@@ -102,17 +108,4 @@ function Get-XcodePairsList {
$result += "$watchName $phoneName"
}
return $result
}
function Test-XcodeStableVersion {
param([Parameter(Mandatory)][string]$Version)
if ($Version -match "beta") {
return $false
}
if ($Version -match "GM") {
return $false
}
return $true
}

View File

@@ -35,13 +35,7 @@ do
echo "Extracting Xcode.app ($VERSION_TO_INSTALL) to ${WORK_DIR} ..."
extractXcodeXip $WORK_DIR "$VERSION_TO_INSTALL"
# Remove "beta" postfix from version
if [[ $XCODE_VERSION == "12_beta" ]] && is_Catalina ; then
# trick to install Xcode 12 GM and Xcode 12 beta 6 side by side
XCODE_VERSION="12_beta"
else
XCODE_VERSION=$(echo $XCODE_VERSION | cut -d"_" -f 1)
fi
XCODE_VERSION=$(echo $XCODE_VERSION | cut -d"_" -f 1)
echo "Checking if unpacked Xcode ${XCODE_VERSION} is valid"
validateXcodeIntegrity "$WORK_DIR"
@@ -55,9 +49,7 @@ do
# Creating a symlink for all Xcode 10* and Xcode 9.3, 9.4 to stay backwards compatible with consumers of the Xcode beta version
createBetaSymlink $XCODE_VERSION
if [ ! $(echo $XCODE_VERSION | grep "beta") ]; then
createXamarinProvisionatorSymlink "$XCODE_VERSION"
fi
createXamarinProvisionatorSymlink "$XCODE_VERSION"
find $WORK_DIR -mindepth 1 -delete
done
@@ -74,12 +66,7 @@ do
continue
fi
if [[ $XCODE_VERSION == "12_beta" ]] && is_Catalina ; then
# trick to install Xcode 12 GM and Xcode 12 beta 6 side by side
XCODE_VERSION="12_beta"
else
XCODE_VERSION=$(echo $XCODE_VERSION | cut -d"_" -f 1)
fi
XCODE_VERSION=$(echo $XCODE_VERSION | cut -d"_" -f 1)
echo "Running 'runFirstLaunch' for Xcode ${XCODE_VERSION}..."
runFirstLaunch $XCODE_VERSION

View File

@@ -40,7 +40,7 @@ Describe "Xcode" {
It "Xcode <XcodeVersion> has correct beta symlink" -TestCases $testCases {
param ( [string] $XcodeVersion )
$xcodesWithBetaSymlink = @("12", "12_beta", "9.3", "9.4")
$xcodesWithBetaSymlink = @("12", "9.3", "9.4")
$shouldBetaSymlinkExists = $XcodeVersion.StartsWith("10") -or $XcodeVersion.StartsWith("11") -or ($XcodeVersion -in $xcodesWithBetaSymlink)
$betaSymlinkPath = Get-XcodeRootPath -Version "${XcodeVersion}_beta"
@@ -56,7 +56,7 @@ Describe "Xcode" {
}
Context "XCODE_DEVELOPER_DIR" {
$stableXcodeVersions = $XCODE_VERSIONS | Where-Object { Test-XcodeStableVersion $_ }
$stableXcodeVersions = $testCases | Where-Object { Test-XcodeStableRelease -Version $_ }
$majorXcodeVersions = $stableXcodeVersions | ForEach-Object { $_.Split(".")[0] } | Select-Object -Unique
$testCases = $majorXcodeVersions | ForEach-Object {
$majorXcodeVersion = $_
@@ -76,7 +76,7 @@ Describe "Xcode" {
$variableName = "XCODE_${MajorXcodeVersion}_DEVELOPER_DIR"
$actualPath = Get-EnvironmentVariable $variableName
$expectedPath = Join-Path (Get-XcodeRootPath -Version $ExpectedVersion) "Contents/Developer"
$actualPath | Should -Exist
$actualPath | Should -Be $expectedPath
}
@@ -84,15 +84,15 @@ Describe "Xcode" {
}
Describe "Xcode simulators" {
$XCODE_VERSIONS | Where-Object { Test-XcodeStableVersion $_ } | ForEach-Object {
$XCODE_VERSIONS | Where-Object { Test-XcodeStableRelease -Version $_ } | ForEach-Object {
Switch-Xcode -Version $_
Context "$_" {
It "No duplicates in devices" {
[array]$devicesList = @(Get-XcodeDevicesList | Where-Object { $_ })
Validate-ArrayWithoutDuplicates $devicesList -Because "Found duplicate device simulators"
}
It "No duplicates in pairs" {
[array]$pairsList = @(Get-XcodePairsList | Where-Object { $_ })
Validate-ArrayWithoutDuplicates $pairsList -Because "Found duplicate pairs simulators"

View File

@@ -2,7 +2,7 @@
"xcode": {
"default": "11.7",
"versions": [
"12.2_beta", "12", "12_beta", "11.7", "11.6", "11.5", "11.4.1", "11.4", "11.3.1", "11.2.1", "11.1", "11", "10.3"
"12.2_beta", "12", "11.7", "11.6", "11.5", "11.4.1", "11.4", "11.3.1", "11.2.1", "11.1", "11", "10.3"
]
},
"xamarin": {

View File

@@ -2,7 +2,7 @@
"xcode": {
"default": "11.7",
"versions": [
"12.2_beta", "12_beta", "11.7"
"12.2_beta", "11.7"
]
},
"xamarin": {