/// <summary> /// Executes the tool with the given arguments /// </summary> /// <param name="Arguments">Command line arguments</param> /// <returns>Exit code</returns> public override int Execute(CommandLineArguments Arguments) { // Output a message if there are any arguments that are still unused Arguments.ApplyTo(this); Arguments.CheckAllArgumentsUsed(); // If the -AllPlatforms argument is specified, add all the known platforms into the list if (bAllPlatforms) { Platforms.UnionWith(UnrealTargetPlatform.GetValidPlatforms()); } // Output a line for each registered platform foreach (UnrealTargetPlatform Platform in Platforms) { UEBuildPlatform BuildPlatform = UEBuildPlatform.GetBuildPlatform(Platform, true); if (BuildPlatform != null && BuildPlatform.HasRequiredSDKsInstalled() == SDKStatus.Valid) { Log.TraceInformation("##PlatformValidate: {0} VALID", Platform.ToString()); } else { Log.TraceInformation("##PlatformValidate: {0} INVALID", Platform.ToString()); } } return(0); }
/// <summary> /// Find all the platforms in a given class /// </summary> /// <param name="Class">Class of platforms to return</param> /// <returns>Array of platforms in the given class</returns> public static UnrealTargetPlatform[] GetPlatformsInClass(UnrealPlatformClass Class) { switch (Class) { case UnrealPlatformClass.All: return(UnrealTargetPlatform.GetValidPlatforms()); case UnrealPlatformClass.Desktop: return(new UnrealTargetPlatform[] { UnrealTargetPlatform.Win32, UnrealTargetPlatform.Win64, UnrealTargetPlatform.Linux, UnrealTargetPlatform.Mac }); case UnrealPlatformClass.Editor: return(new UnrealTargetPlatform[] { UnrealTargetPlatform.Win64, UnrealTargetPlatform.Linux, UnrealTargetPlatform.Mac }); case UnrealPlatformClass.Server: return(new UnrealTargetPlatform[] { UnrealTargetPlatform.Win32, UnrealTargetPlatform.Win64, UnrealTargetPlatform.Linux, UnrealTargetPlatform.Mac }); } throw new ArgumentException(String.Format("'{0}' is not a valid value for UnrealPlatformClass", (int)Class)); }
/// <summary> /// Determines whether the given suffix is valid for a child plugin /// </summary> /// <param name="Suffix"></param> /// <returns>Whether the suffix is appopriate</returns> private static bool IsValidChildPluginSuffix(string Suffix) { foreach (UnrealPlatformGroup Group in UnrealPlatformGroup.GetValidGroups()) { if (Group.ToString().Equals(Suffix, StringComparison.InvariantCultureIgnoreCase)) { return(true); } } foreach (UnrealTargetPlatform Platform in UnrealTargetPlatform.GetValidPlatforms()) { if (Platform.ToString().Equals(Suffix, StringComparison.InvariantCultureIgnoreCase)) { return(true); } } return(false); }
/// <summary> /// Given a list of supported platforms, returns a list of names of platforms that should not be supported /// </summary> /// <param name="SupportedPlatforms">List of supported platforms</param> /// <returns>List of unsupported platforms in string format</returns> public static List <string> MakeListOfUnsupportedPlatforms(List <UnrealTargetPlatform> SupportedPlatforms) { // Make a list of all platform name strings that we're *not* currently compiling, to speed // up file path comparisons later on List <string> OtherPlatformNameStrings = new List <string>(); { List <UnrealPlatformGroup> SupportedGroups = new List <UnrealPlatformGroup>(); // look at each group to see if any supported platforms are in it foreach (UnrealPlatformGroup Group in UnrealPlatformGroup.GetValidGroups()) { // get the list of platforms registered to this group, if any List <UnrealTargetPlatform> Platforms = UEBuildPlatform.GetPlatformsInGroup(Group); if (Platforms != null) { // loop over each one foreach (UnrealTargetPlatform Platform in Platforms) { // if it's a compiled platform, then add this group to be supported if (SupportedPlatforms.Contains(Platform)) { SupportedGroups.Add(Group); } } } } // loop over groups one more time, anything NOT in SupportedGroups is now unsupported, and should be added to the output list foreach (UnrealPlatformGroup Group in UnrealPlatformGroup.GetValidGroups()) { if (SupportedGroups.Contains(Group) == false) { OtherPlatformNameStrings.Add(Group.ToString()); } } foreach (UnrealTargetPlatform CurPlatform in UnrealTargetPlatform.GetValidPlatforms()) { bool ShouldConsider = true; // If we have a platform and a group with the same name, don't add the platform // to the other list if the same-named group is supported. This is a lot of // lines because we need to do the comparisons as strings. string CurPlatformString = CurPlatform.ToString(); foreach (UnrealPlatformGroup Group in UnrealPlatformGroup.GetValidGroups()) { if (Group.ToString().Equals(CurPlatformString)) { ShouldConsider = false; break; } } // Don't add our current platform to the list of platform sub-directory names that // we'll skip source files for if (ShouldConsider && !SupportedPlatforms.Contains(CurPlatform)) { OtherPlatformNameStrings.Add(CurPlatform.ToString()); } } return(OtherPlatformNameStrings); } }