Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Scripts/CheckXcodeVersion.cs
jonathan adamczewski 686a3a2f46 Cache the xcode version obtained from xcodebuild
Each invocation of `xcodebuild -version` can take > 100ms. Caching the result reduces startup time of UnrealBuildTool and AutomationTool by 1-2 seconds.

#jira none

[CL 16999582 by jonathan adamczewski in ue5-main branch]
2021-07-29 15:03:25 -04:00

38 lines
1009 B
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace AutomationTool
{
[Help("Checks that the installed Xcode version is the version specified.")]
[Help("-Version", "The expected version number")]
class CheckXcodeVersion : BuildCommand
{
public override void ExecuteBuild()
{
string RequestedVersion = ParseParamValue("Version");
if(RequestedVersion == null)
{
throw new AutomationException("Missing -Version=... parameter");
}
string InstalledSdkVersion = UnrealBuildBase.ApplePlatformSDK.InstalledSDKVersion;
if (InstalledSdkVersion == null)
{
throw new AutomationException("Unable to query version number from xcodebuild");
}
if (InstalledSdkVersion != RequestedVersion)
{
LogWarning("Installed Xcode version is {0} - expected {1}", InstalledSdkVersion, RequestedVersion);
}
}
}
}