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 { function Test-XcodeStableRelease {
param( param (
[Parameter(Mandatory)] [Parameter(ParameterSetName = 'Version')]
[string] $Version,
[Parameter(ParameterSetName = 'Path')]
[string] $XcodeRootPath [string] $XcodeRootPath
) )
if ($PSCmdlet.ParameterSetName -eq "Version") {
$XcodeRootPath = Get-XcodeRootPath $Version
}
$licenseInfoPlistPath = Join-Path $XcodeRootPath "Contents" "Resources" "LicenseInfo.plist" $licenseInfoPlistPath = Join-Path $XcodeRootPath "Contents" "Resources" "LicenseInfo.plist"
$releaseType = & defaults read $licenseInfoPlistPath "licenseType" $releaseType = & defaults read $licenseInfoPlistPath "licenseType"
return -not ($releaseType -match "beta") return -not ($releaseType -match "beta")
@@ -102,17 +108,4 @@ function Get-XcodePairsList {
$result += "$watchName $phoneName" $result += "$watchName $phoneName"
} }
return $result 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} ..." echo "Extracting Xcode.app ($VERSION_TO_INSTALL) to ${WORK_DIR} ..."
extractXcodeXip $WORK_DIR "$VERSION_TO_INSTALL" extractXcodeXip $WORK_DIR "$VERSION_TO_INSTALL"
# Remove "beta" postfix from version XCODE_VERSION=$(echo $XCODE_VERSION | cut -d"_" -f 1)
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
echo "Checking if unpacked Xcode ${XCODE_VERSION} is valid" echo "Checking if unpacked Xcode ${XCODE_VERSION} is valid"
validateXcodeIntegrity "$WORK_DIR" 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 # 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 createBetaSymlink $XCODE_VERSION
if [ ! $(echo $XCODE_VERSION | grep "beta") ]; then createXamarinProvisionatorSymlink "$XCODE_VERSION"
createXamarinProvisionatorSymlink "$XCODE_VERSION"
fi
find $WORK_DIR -mindepth 1 -delete find $WORK_DIR -mindepth 1 -delete
done done
@@ -74,12 +66,7 @@ do
continue continue
fi fi
if [[ $XCODE_VERSION == "12_beta" ]] && is_Catalina ; then XCODE_VERSION=$(echo $XCODE_VERSION | cut -d"_" -f 1)
# 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
echo "Running 'runFirstLaunch' for Xcode ${XCODE_VERSION}..." echo "Running 'runFirstLaunch' for Xcode ${XCODE_VERSION}..."
runFirstLaunch $XCODE_VERSION runFirstLaunch $XCODE_VERSION

View File

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

View File

@@ -2,7 +2,7 @@
"xcode": { "xcode": {
"default": "11.7", "default": "11.7",
"versions": [ "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": { "xamarin": {

View File

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