/// <summary> /// Returns true/false based on whether the project supports a client configuration /// </summary> /// <param name="ProjectName"></param> /// <returns></returns> bool ProjectSupportsClientBuild(FileReference InProjectFile) { if (InProjectFile == null) { // UE4 return(true); } ProjectProperties Properties = ProjectUtils.GetProjectProperties(InProjectFile); return(Properties.Targets.Where(T => T.TargetName.Contains("Client")).Any()); }
public override void ExecuteBuild() { // get the project var UProjectFileName = ParseParamValue("Project"); if (UProjectFileName == null) { throw new AutomationException("Project was not specified via the -project argument."); } // Get the list of targets var TargetList = ParseParamList("Target"); if (TargetList == null) { throw new AutomationException("Target was not specified via the -target argument."); } // get the list of platforms var PlatformList = ParseParamList("TargetPlatforms", "Win64"); List <UnrealTargetPlatform> TargetPlatforms = new List <UnrealTargetPlatform>(); foreach (string Platform in PlatformList) { TargetPlatforms.Add((UnrealTargetPlatform)Enum.Parse(typeof(UnrealTargetPlatform), Platform, true)); } // get the list configurations var ConfigList = ParseParamList("Config", "Development"); List <UnrealTargetConfiguration> ConfigsToBuild = new List <UnrealTargetConfiguration>(); foreach (string Config in ConfigList) { ConfigsToBuild.Add((UnrealTargetConfiguration)Enum.Parse(typeof(UnrealTargetConfiguration), Config, true)); } // parse any extra parameters bool bClean = ParseParam("Clean"); int WorkingCL = ParseParamInt("P4Change"); FileReference UProjectFileReference = new FileReference(UProjectFileName); // add the targets to the agenda // verify the targets and add them to the agenda var Properties = ProjectUtils.GetProjectProperties(UProjectFileReference); UE4Build.BuildAgenda Agenda = new UE4Build.BuildAgenda(); foreach (string Target in TargetList) { SingleTargetProperties TargetData; if (!Properties.Targets.TryGetValue((TargetRules.TargetType)Enum.Parse(typeof(TargetRules.TargetType), Target), out TargetData)) { throw new AutomationException("Project does not support specified target: {0}", Target); } foreach (UnrealTargetPlatform TargetPlatform in TargetPlatforms) { if (TargetData.Rules.SupportsPlatform(TargetPlatform)) { List <UnrealTargetConfiguration> SupportedConfigurations = new List <UnrealTargetConfiguration>(); TargetData.Rules.GetSupportedConfigurations(ref SupportedConfigurations, true); foreach (UnrealTargetConfiguration TargetConfig in ConfigsToBuild) { if (SupportedConfigurations.Contains(TargetConfig)) { Agenda.AddTarget(TargetData.TargetName, TargetPlatform, TargetConfig, UProjectFileReference); } else { Log("{0} doesn't support the {1} configuration. It will not be built.", TargetData.TargetName, TargetConfig); } } } else { Log("{0} doesn't support the {1} platform. It will not be built.", TargetData.TargetName, TargetPlatform); } } } // build it UE4Build Build = new UE4Build(this); Build.Build(Agenda, InDeleteBuildProducts: bClean, InUpdateVersionFiles: WorkingCL > 0); if (WorkingCL > 0) // only move UAT files if we intend to check in some build products { Build.AddUATFilesToBuildProducts(); } UE4Build.CheckBuildProducts(Build.BuildProductFiles); if (WorkingCL > 0) { // Sign everything we built CodeSign.SignMultipleIfEXEOrDLL(this, Build.BuildProductFiles); // Open files for add or edit UE4Build.AddBuildProductsToChangelist(WorkingCL, Build.BuildProductFiles); } }