need to test

This commit is contained in:
Maxim Lobanov
2020-10-31 18:41:04 +03:00
parent 14a848397e
commit b49a705f6b
9 changed files with 245 additions and 222 deletions

View File

@@ -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