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

@@ -8,9 +8,7 @@ function Get-XcodeRootPath {
}
function Get-DefaultXcodeRootPath {
$defaultXcodePath = "/Applications/Xcode.app"
$defaultXcodeItem = Get-Item -Path $defaultXcodePath
return $defaultXcodeItem.Target
return (Get-Item -Path "/Applications/Xcode.app").Target
}
function Get-XcodeToolPath {
@@ -29,6 +27,22 @@ function Get-XcodeToolPath {
return Join-Path $XcodeRootPath "Contents/Developer/usr/bin" $ToolName
}
function Get-XcodeVersionInfo {
param(
[Parameter(Mandatory)]
[string]$XcodeRootPath
)
$xcodebuildPath = Get-XcodeToolPath -XcodeRootPath $XcodeRootPath -ToolName "xcodebuild"
[string]$output = Invoke-Expression "$xcodebuildPath -version"
$versionOutputParts = $output.Split(" ")
return @{
Version = [System.Version]::Parse($versionOutputParts[1])
Build = $versionOutputParts[4]
}
}
function Switch-Xcode {
param (
[Parameter(ParameterSetName = 'Version')]