2019-12-26 23:01:54 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2018-12-14 11:21:22 -05:00
|
|
|
|
2018-09-25 10:11:35 -04:00
|
|
|
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()
|
|
|
|
|
{
|
2021-07-29 15:03:25 -04:00
|
|
|
string RequestedVersion = ParseParamValue("Version");
|
|
|
|
|
if(RequestedVersion == null)
|
2018-09-25 10:11:35 -04:00
|
|
|
{
|
|
|
|
|
throw new AutomationException("Missing -Version=... parameter");
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-29 15:03:25 -04:00
|
|
|
string InstalledSdkVersion = UnrealBuildBase.ApplePlatformSDK.InstalledSDKVersion;
|
2018-09-25 10:11:35 -04:00
|
|
|
|
2021-07-29 15:03:25 -04:00
|
|
|
if (InstalledSdkVersion == null)
|
2018-09-25 10:11:35 -04:00
|
|
|
{
|
2021-07-29 15:03:25 -04:00
|
|
|
throw new AutomationException("Unable to query version number from xcodebuild");
|
2018-09-25 10:11:35 -04:00
|
|
|
}
|
2021-07-29 15:03:25 -04:00
|
|
|
|
|
|
|
|
if (InstalledSdkVersion != RequestedVersion)
|
2018-09-25 10:11:35 -04:00
|
|
|
{
|
2021-07-29 15:03:25 -04:00
|
|
|
LogWarning("Installed Xcode version is {0} - expected {1}", InstalledSdkVersion, RequestedVersion);
|
2018-09-25 10:11:35 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|