diff --git a/images/macos/helpers/Xcode.Helpers.psm1 b/images/macos/helpers/Xcode.Helpers.psm1 index dbc4803c2..c4a5ca70e 100644 --- a/images/macos/helpers/Xcode.Helpers.psm1 +++ b/images/macos/helpers/Xcode.Helpers.psm1 @@ -45,6 +45,14 @@ function Switch-Xcode { Invoke-Expression "sudo xcode-select --switch ${XcodeRootPath}" } +function Test-XcodeStableRelease { + param([string] $XcodeRootPath) + + $licenseInfoPlistPath = Join-Path $XcodeRootPath "Contents" "Resources" "LicenseInfo.plist" + $releaseType = & defaults read $licenseInfoPlistPath "licenseType" + return -not ($releaseType -match "beta") +} + function Get-XcodeSimulatorsInfo { param( [string] $Filter @@ -102,6 +110,6 @@ function Test-XcodeStableVersion { if ($Version -match "GM") { return $false } - + return $true } \ No newline at end of file diff --git a/images/macos/software-report/SoftwareReport.Xcode.psm1 b/images/macos/software-report/SoftwareReport.Xcode.psm1 index 59754d583..3d4cfa52d 100644 --- a/images/macos/software-report/SoftwareReport.Xcode.psm1 +++ b/images/macos/software-report/SoftwareReport.Xcode.psm1 @@ -46,7 +46,8 @@ function Get-XcodeInfoList { $versionInfo = Get-XcodeVersionInfo $versionInfo.Path = $xcodeRootPath $versionInfo.IsDefault = ($xcodeRootPath -eq $defaultXcodeRootPath) - + $versionInfo.IsStable = Test-XcodeStableRelease -XcodeRootPath $xcodeRootPath + $xcodeInfo.Add($xcodeRootPath, [PSCustomObject] @{ VersionInfo = $versionInfo SDKInfo = Get-XcodeSDKList @@ -91,6 +92,7 @@ function Build-XcodeTable { $xcodeList = $xcodeInfo.Values | ForEach-Object { $_.VersionInfo } | Sort-Object $sortRules return $xcodeList | ForEach-Object { $defaultPostfix = If ($_.IsDefault) { " (default)" } else { "" } + $betaPostfix = If ($_.IsStable) { "" } else { " (beta)" } return [PSCustomObject] @{ "Version" = $_.Version.ToString() + $betaPostfix + $defaultPostfix "Build" = $_.Build