Add XCode version parsing
This commit is contained in:
@@ -32,16 +32,32 @@ namespace Flax.Build.Platforms
|
|||||||
return;
|
return;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
// Get path
|
||||||
RootPath = Utilities.ReadProcessOutput("xcode-select", "--print-path");
|
RootPath = Utilities.ReadProcessOutput("xcode-select", "--print-path");
|
||||||
if (string.IsNullOrEmpty(RootPath) || !Directory.Exists(RootPath))
|
if (string.IsNullOrEmpty(RootPath) || !Directory.Exists(RootPath))
|
||||||
return;
|
return;
|
||||||
IsValid = true;
|
IsValid = true;
|
||||||
Version = new Version(1, 0);
|
Version = new Version(1, 0);
|
||||||
Log.Verbose(string.Format("Found XCode at {0}", RootPath));
|
|
||||||
|
// Get version (optional)
|
||||||
|
var versionText = Utilities.ReadProcessOutput("xcodebuild", "-version");
|
||||||
|
var versionLines = versionText?.Split('\n') ?? null;
|
||||||
|
if (versionLines != null && versionLines.Length != 0)
|
||||||
|
{
|
||||||
|
versionText = versionLines[0].Trim();
|
||||||
|
var versionParts = versionText.Split(' ');
|
||||||
|
if (versionParts != null && versionParts.Length > 1)
|
||||||
|
{
|
||||||
|
versionText = versionParts[1].Trim();
|
||||||
|
if (Version.TryParse(versionText, out var v))
|
||||||
|
Version = v;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Log.Verbose(string.Format("Found XCode {1} at {0}", RootPath, Version));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user