mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
need to test
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Import-Module "$PSScriptRoot/../helpers/Common.Helpers.psm1"
|
||||
Import-Module "$PSScriptRoot/../helpers/Xcode.Helpers.psm1"
|
||||
|
||||
$os = Get-OSVersion
|
||||
|
||||
@@ -7,19 +8,16 @@ function Get-XcodePaths {
|
||||
return $xcodePaths | Select-Object -ExpandProperty Fullname
|
||||
}
|
||||
|
||||
function Get-XcodeVersionInfo {
|
||||
[string]$output = Invoke-Expression "xcodebuild -version"
|
||||
$versionOutputParts = $output.Split(" ")
|
||||
return @{
|
||||
Version = [System.Version]::Parse($versionOutputParts[1])
|
||||
Build = $versionOutputParts[4]
|
||||
}
|
||||
}
|
||||
|
||||
function Get-XcodeSDKList {
|
||||
$versionInfo = Get-XcodeVersionInfo
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
[string]$XcodeRootPath
|
||||
)
|
||||
|
||||
$versionInfo = Get-XcodeVersionInfo -XcodeRootPath $XcodeRootPath
|
||||
$xcodebuildPath = Get-XcodeToolPath -XcodeRootPath $XcodeRootPath -ToolName "xcodebuild"
|
||||
if ($versionInfo.Version -le [System.Version]::Parse("9.4.1")) {
|
||||
$output = Invoke-Expression "xcodebuild -showsdks"
|
||||
$output = Invoke-Expression "$xcodebuildPath -showsdks"
|
||||
$sdkList = $output | Where-Object { $_ -Match "-sdk" }
|
||||
|
||||
return $sdkList | ForEach-Object {
|
||||
@@ -31,7 +29,7 @@ function Get-XcodeSDKList {
|
||||
}
|
||||
}
|
||||
|
||||
[string]$output = Invoke-Expression "xcodebuild -showsdks -json"
|
||||
[string]$output = Invoke-Expression "$xcodebuildPath -showsdks -json"
|
||||
return $output | ConvertFrom-Json
|
||||
}
|
||||
|
||||
@@ -43,7 +41,7 @@ function Get-XcodeInfoList {
|
||||
$xcodeRootPath = $_
|
||||
Switch-Xcode -XcodeRootPath $xcodeRootPath
|
||||
|
||||
$versionInfo = Get-XcodeVersionInfo
|
||||
$versionInfo = Get-XcodeVersionInfo -XcodeRootPath $xcodeRootPath
|
||||
$versionInfo.Path = $xcodeRootPath
|
||||
$versionInfo.IsDefault = ($xcodeRootPath -eq $defaultXcodeRootPath)
|
||||
$versionInfo.IsStable = Test-XcodeStableRelease -XcodeRootPath $xcodeRootPath
|
||||
|
||||
Reference in New Issue
Block a user