public override List<UnrealTargetPlatform> GUBP_GetPlatforms_MonolithicOnly(UnrealTargetPlatform HostPlatform) { List<UnrealTargetPlatform> Platforms = null; switch (HostPlatform) { case UnrealTargetPlatform.Mac: Platforms = new List<UnrealTargetPlatform> { UnrealTargetPlatform.IOS }; break; case UnrealTargetPlatform.Linux: Platforms = new List<UnrealTargetPlatform>(); break; case UnrealTargetPlatform.Win64: Platforms = new List<UnrealTargetPlatform>(); break; default: Platforms = new List<UnrealTargetPlatform>(); break; } return Platforms; }
// NOTE: If we're building a monolithic binary, then the game and engine code are linked together into one // program executable, so we want the application name to be the game name. In the case of a modular // binary, we use 'UnrealEngine' for our application name public UEBuildEditor( string InGameName, UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration, TargetRules InRulesObject, List<string> InAdditionalDefinitions, string InRemoteRoot, List<OnlyModule> InOnlyModules, bool bInEditorRecompile) : base(InAppName:UEBuildTarget.GetBinaryBaseName( InGameName, InRulesObject, InPlatform, InConfiguration, (InRulesObject.Type == TargetRules.TargetType.Editor) ? "Editor" : "" ), InGameName:InGameName, InPlatform:InPlatform, InConfiguration:InConfiguration, InRulesObject: InRulesObject, InAdditionalDefinitions:InAdditionalDefinitions, InRemoteRoot:InRemoteRoot, InOnlyModules:InOnlyModules, bInEditorRecompile: bInEditorRecompile) { }
// NOTE: If we're building a monolithic binary, then the game and engine code are linked together into one // program executable, so we want the application name to be the game name. In the case of a modular // binary, we use 'UnrealEngine' for our application name public UEBuildClient( string InGameName, UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration, TargetRules InRulesObject, List<string> InAdditionalDefinitions, string InRemoteRoot, List<OnlyModule> InOnlyModules) : base(InAppName: UEBuildTarget.GetBinaryBaseName(InGameName, InRulesObject, InPlatform, InConfiguration, "Client"), InGameName: InGameName, InPlatform: InPlatform, InConfiguration: InConfiguration, InRulesObject: InRulesObject, InAdditionalDefinitions: InAdditionalDefinitions, InRemoteRoot: InRemoteRoot, InOnlyModules: InOnlyModules) { if (ShouldCompileMonolithic()) { if ((UnrealBuildTool.IsDesktopPlatform(Platform) == false) || (Platform == UnrealTargetPlatform.WinRT) || (Platform == UnrealTargetPlatform.WinRT_ARM)) { // We are compiling for a console... // We want the output to go into the <GAME>\Binaries folder if (InRulesObject.bOutputToEngineBinaries == false) { OutputPath = OutputPath.Replace("Engine\\Binaries", InGameName + "\\Binaries"); } } } }
static string GetBlueprintPluginPathArgument(ProjectParams Params, bool Client, UnrealTargetPlatform TargetPlatform) { string ScriptPluginArgs = ""; // if we're utilizing an auto-generated code plugin/module (a product of // the cook process), make sure to compile it along with the targets here if (Params.RunAssetNativization) { ProjectParams.BlueprintPluginKey PluginKey = new ProjectParams.BlueprintPluginKey(); PluginKey.Client = Client; PluginKey.TargetPlatform = TargetPlatform; FileReference CodePlugin = null; if(Params.BlueprintPluginPaths.TryGetValue(PluginKey, out CodePlugin)) { ScriptPluginArgs += "-PLUGIN \"" + CodePlugin + "\" "; } else { LogWarning("BlueprintPluginPath for " + TargetPlatform + " " + (Client ? "client" : "server") + " was not found"); } } return ScriptPluginArgs; }
static void AddPluginToAgenda(UE4Build.BuildAgenda Agenda, string PluginFileName, PluginDescriptor Plugin, string TargetName, TargetRules.TargetType TargetType, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, List<string> ReceiptFileNames, string InAdditionalArgs) { // Find a list of modules that need to be built for this plugin List<string> ModuleNames = new List<string>(); foreach(ModuleDescriptor Module in Plugin.Modules) { bool bBuildDeveloperTools = (TargetType == TargetRules.TargetType.Editor || TargetType == TargetRules.TargetType.Program); bool bBuildEditor = (TargetType == TargetRules.TargetType.Editor); if(Module.IsCompiledInConfiguration(Platform, TargetType, bBuildDeveloperTools, bBuildEditor)) { ModuleNames.Add(Module.Name); } } // Add these modules to the build agenda if(ModuleNames.Count > 0) { string Arguments = String.Format("-plugin {0}", CommandUtils.MakePathSafeToUseWithCommandLine(PluginFileName)); foreach(string ModuleName in ModuleNames) { Arguments += String.Format(" -module {0}", ModuleName); } string ReceiptFileName = BuildReceipt.GetDefaultPath(Path.GetDirectoryName(PluginFileName), TargetName, Platform, Configuration, ""); Arguments += String.Format(" -receipt {0}", CommandUtils.MakePathSafeToUseWithCommandLine(ReceiptFileName)); ReceiptFileNames.Add(ReceiptFileName); if(!String.IsNullOrEmpty(InAdditionalArgs)) { Arguments += InAdditionalArgs; } Agenda.AddTarget(TargetName, Platform, Configuration, InAddArgs: Arguments); } }
public override Dictionary<string, List<UnrealTargetPlatform>> GUBP_NonCodeProjects_BaseEditorTypeOnly(UnrealTargetPlatform HostPlatform) { var NonCodeProjectNames = new Dictionary<string, List<UnrealTargetPlatform>>(); NonCodeProjectNames.Add("Elemental", new List<UnrealTargetPlatform> { HostPlatform }); NonCodeProjectNames.Add("Infiltrator", new List<UnrealTargetPlatform> { HostPlatform }); NonCodeProjectNames.Add("HoverShip", new List<UnrealTargetPlatform> { HostPlatform }); NonCodeProjectNames.Add("Blueprint_Examples", new List<UnrealTargetPlatform> { HostPlatform }); NonCodeProjectNames.Add("Reflections", new List<UnrealTargetPlatform> { HostPlatform }); NonCodeProjectNames.Add("ContentExamples", new List<UnrealTargetPlatform> { HostPlatform }); NonCodeProjectNames.Add("MobileTemple", new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Android, UnrealTargetPlatform.IOS }); NonCodeProjectNames.Add("TappyChicken", new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Android, UnrealTargetPlatform.IOS }); NonCodeProjectNames.Add("SwingNinja", new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Android, UnrealTargetPlatform.IOS }); NonCodeProjectNames.Add("Mobile", new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Android, UnrealTargetPlatform.IOS }); NonCodeProjectNames.Add("TP_FirstPersonBP", new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Android, UnrealTargetPlatform.IOS }); NonCodeProjectNames.Add("TP_FlyingBP", new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Android, UnrealTargetPlatform.IOS }); NonCodeProjectNames.Add("TP_SideScrollerBP", new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Android, UnrealTargetPlatform.IOS }); NonCodeProjectNames.Add("TP_StarterContentBP", new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Android, UnrealTargetPlatform.IOS }); NonCodeProjectNames.Add("TP_ThirdPersonBP", new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Android, UnrealTargetPlatform.IOS }); NonCodeProjectNames.Add("TP_TopDownBP", new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Android, UnrealTargetPlatform.IOS }); NonCodeProjectNames.Add("TP_VehicleBP", new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Android, UnrealTargetPlatform.IOS }); return NonCodeProjectNames; }
public UEBuildServer( string InGameName, UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration, TargetRules InRulesObject, List<string> InAdditionalDefinitions, string InRemoteRoot, List<OnlyModule> InOnlyModules, bool bInEditorRecompile) // NOTE: If we're building a monolithic binary, then the game and engine code are linked together into one // program executable, so we want the application name to be the game name. In the case of a modular // binary, we use 'UnrealEngine' for our application name : base( InAppName:UEBuildTarget.GetBinaryBaseName(InGameName, InRulesObject, InPlatform, InConfiguration, "Server"), InGameName:InGameName, InPlatform:InPlatform, InConfiguration:InConfiguration, InRulesObject: InRulesObject, InAdditionalDefinitions:InAdditionalDefinitions, InRemoteRoot:InRemoteRoot, InOnlyModules:InOnlyModules, bInEditorRecompile: bInEditorRecompile ) { }
/// <summary> /// Constructor /// </summary> /// <param name="InName">Name of the target that may be built.</param> /// <param name="InType">Specifies the type of the targtet to generate.</param> /// <param name="InProductName">Specifies the name of the executable if it differs from the InName</param> /// <param name="InTargetPlatform">Name of the target that may be built.</param> /// <param name="InDependencies">Name of the target that may be built.</param> /// <param name="bHasPlist">Name of the target that may be built.</param> public XcodeProjectTarget(string InDisplayName, string InTargetName, XcodeTargetType InType, string InTargetFilePath, string InProductName = "", UnrealTargetPlatform InTargetPlatform = UnrealTargetPlatform.Mac, bool bInIsMacOnly = false, List<XcodeTargetDependency> InDependencies = null, bool bHasPlist = false, List<XcodeFrameworkRef> InFrameworks = null) { DisplayName = InDisplayName; TargetName = InTargetName; Type = InType; ProductName = InProductName; TargetFilePath = InTargetFilePath; TargetPlatform = InTargetPlatform; bIsMacOnly = bInIsMacOnly; Guid = XcodeProjectFileGenerator.MakeXcodeGuid(); BuildConfigGuild = XcodeProjectFileGenerator.MakeXcodeGuid(); SourcesPhaseGuid = XcodeProjectFileGenerator.MakeXcodeGuid(); ResourcesPhaseGuid = XcodeProjectFileGenerator.MakeXcodeGuid(); FrameworksPhaseGuid = XcodeProjectFileGenerator.MakeXcodeGuid(); ShellScriptPhaseGuid = XcodeProjectFileGenerator.MakeXcodeGuid(); ProductGuid = XcodeProjectFileGenerator.MakeXcodeGuid(); DebugConfigGuid = XcodeProjectFileGenerator.MakeXcodeGuid(); DevelopmentConfigGuid = XcodeProjectFileGenerator.MakeXcodeGuid(); ShippingConfigGuid = XcodeProjectFileGenerator.MakeXcodeGuid(); TestConfigGuid = XcodeProjectFileGenerator.MakeXcodeGuid(); DebugGameConfigGuid = XcodeProjectFileGenerator.MakeXcodeGuid(); Dependencies = InDependencies == null ? new List<XcodeTargetDependency>() : InDependencies; FrameworkRefs = InFrameworks == null ? new List<XcodeFrameworkRef>() : InFrameworks; // Meant to prevent adding plists that don't belong to the target, like in the case of Mac builds. if (bHasPlist) { PlistGuid = XcodeProjectFileGenerator.MakeXcodeGuid(); } }
private void AddCustomNodes(UnrealTargetPlatform InHostPlatform) { if (Adders == null) { Adders = new List<GUBPNodeAdder>(); Assembly[] LoadedAssemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (var Dll in LoadedAssemblies) { Type[] AllTypes = GetTypesFromAssembly(Dll); foreach (var PotentialConfigType in AllTypes) { if (PotentialConfigType != typeof(GUBPNodeAdder) && typeof(GUBPNodeAdder).IsAssignableFrom(PotentialConfigType)) { GUBPNodeAdder Config = Activator.CreateInstance(PotentialConfigType) as GUBPNodeAdder; if (Config != null) { Adders.Add(Config); } } } } } foreach(var Adder in Adders) { Adder.AddNodes(this, InHostPlatform); } }
/// <summary> /// Reads an array from the config files, matching a given section and key. /// </summary> public static void ReadArray(string ProjectDirectory, UnrealTargetPlatform Platform, string BaseIniName, string FindSection, string FindKey, List<string> Values) { foreach (string IniFileName in EnumerateIniFileNames(ProjectDirectory, Platform, BaseIniName)) { if (File.Exists(IniFileName)) { bool bInCorrectSection = false; foreach(string Line in File.ReadAllLines(IniFileName)) { // Skip the whitespace at the start of the line int LineMin = 0; while(LineMin < Line.Length && Char.IsWhiteSpace(Line[LineMin])) LineMin++; // Skip the whitespace at the end of the line int LineMax = Line.Length; while (LineMax > LineMin && Char.IsWhiteSpace(Line[LineMax - 1])) LineMax--; // Check it's not a comment if (LineMax > LineMin && Line[LineMin] != ';') { if (Line[LineMin] == '[' && Line[LineMax - 1] == ']') { // This is a section heading. Check if it's the section we're looking for. bInCorrectSection = (FindSection.Length == LineMax - LineMin - 2 && String.Compare(Line, LineMin + 1, FindSection, 0, LineMax - LineMin - 2) == 0); } else if (bInCorrectSection) { // Split the line into key/value. TryParseArrayKeyValue(Line, LineMin, LineMax, FindKey, Values); } } } } } }
public override bool GUBP_AlwaysBuildWithTools(UnrealTargetPlatform InHostPlatform, out bool bInternalToolOnly, out bool SeparateNode, out bool CrossCompile) { bInternalToolOnly = false; SeparateNode = false; CrossCompile = false; return true; }
public override List<GUBPFormalBuild> GUBP_GetConfigsForFormalBuilds_MonolithicOnly(UnrealTargetPlatform HostPlatform) { if (HostPlatform == UnrealTargetPlatform.Win64) { return new List<GUBPFormalBuild> { new GUBPFormalBuild(UnrealTargetPlatform.Win32, UnrealTargetConfiguration.Development), new GUBPFormalBuild(UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Development), new GUBPFormalBuild(UnrealTargetPlatform.XboxOne, UnrealTargetConfiguration.Development), new GUBPFormalBuild(UnrealTargetPlatform.PS4, UnrealTargetConfiguration.Development), new GUBPFormalBuild(UnrealTargetPlatform.Win32, UnrealTargetConfiguration.Test), new GUBPFormalBuild(UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Test), new GUBPFormalBuild(UnrealTargetPlatform.XboxOne, UnrealTargetConfiguration.Test), new GUBPFormalBuild(UnrealTargetPlatform.PS4, UnrealTargetConfiguration.Test), new GUBPFormalBuild(UnrealTargetPlatform.Win32, UnrealTargetConfiguration.Shipping), new GUBPFormalBuild(UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Shipping), new GUBPFormalBuild(UnrealTargetPlatform.XboxOne, UnrealTargetConfiguration.Shipping), new GUBPFormalBuild(UnrealTargetPlatform.PS4, UnrealTargetConfiguration.Shipping), }; } else { return new List<GUBPFormalBuild> { new GUBPFormalBuild(UnrealTargetPlatform.Mac, UnrealTargetConfiguration.Development), new GUBPFormalBuild(UnrealTargetPlatform.Mac, UnrealTargetConfiguration.Test), new GUBPFormalBuild(UnrealTargetPlatform.Mac, UnrealTargetConfiguration.Shipping), }; } }
public override bool GUBP_AlwaysBuildWithTools(UnrealTargetPlatform InHostPlatform, bool bBuildingRocket, out bool bInternalToolOnly, out bool SeparateNode, out bool CrossCompile) { bInternalToolOnly = false; SeparateNode = false; CrossCompile = false; return (InHostPlatform == UnrealTargetPlatform.Win64); }
public override GUBPProjectOptions GUBP_IncludeProjectInPromotedBuild_EditorTypeOnly(UnrealTargetPlatform HostPlatform) { var Result = new GUBPProjectOptions(); Result.bTestWithShared = false; Result.bIsNonCode = true; return Result; }
public override List<UnrealTargetPlatform> GUBP_GetPlatforms_MonolithicOnly(UnrealTargetPlatform HostPlatform) { if (HostPlatform == UnrealTargetPlatform.Mac) { return new List<UnrealTargetPlatform>{UnrealTargetPlatform.Mac}; } return new List<UnrealTargetPlatform> { UnrealTargetPlatform.Win32, UnrealTargetPlatform.Win64, UnrealTargetPlatform.PS4, UnrealTargetPlatform.XboxOne }; }
public override List<UnrealTargetPlatform> GUBP_GetPlatforms_MonolithicOnly(UnrealTargetPlatform HostPlatform) { if (HostPlatform == UnrealTargetPlatform.Mac) { return new List<UnrealTargetPlatform>(); } return new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Win32, UnrealTargetPlatform.Linux }; }
/// <summary> /// Allow various platform project generators to generate any special project properties if required /// </summary> /// <param name="InPlatform"></param> /// <returns></returns> public static bool GenerateGamePlatformSpecificProperties(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration Configuration, TargetRules.TargetType TargetType, StringBuilder VCProjectFileContent, string RootDirectory, string TargetFilePath) { if (ProjectGeneratorDictionary.ContainsKey(InPlatform) == true) { ProjectGeneratorDictionary[InPlatform].GenerateGameProperties(Configuration, VCProjectFileContent, TargetType, RootDirectory, TargetFilePath); ; } return true; }
public override List<UnrealTargetPlatform> GUBP_ToolPlatforms(UnrealTargetPlatform InHostPlatform) { if (InHostPlatform == UnrealTargetPlatform.Win64) { return new List<UnrealTargetPlatform> { UnrealTargetPlatform.Win64, UnrealTargetPlatform.Win32}; } return base.GUBP_ToolPlatforms(InHostPlatform); }
protected void RegisterRemoteToolChain(UnrealTargetPlatform InPlatform, CPPTargetPlatform CPPPlatform) { RemoteToolChainPlatform = InPlatform; // Register this tool chain for IOS Log.TraceVerbose(" Registered for {0}", CPPPlatform.ToString()); UEToolChain.RegisterPlatformToolChain(CPPPlatform, this); }
public override bool ShouldCompileMonolithic(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration) { if (UnrealBuildTool.UnrealBuildTool.CommandLineContains("-monolithic") == true) { return true; } return false; }
public override bool CanHostPlatform(UnrealTargetPlatform Platform) { if (Platform == UnrealTargetPlatform.IOS || Platform == UnrealTargetPlatform.Mac) { return true; } return false; }
/** * Return the VisualStudio platform name for this build platform * * @param InPlatform The UnrealTargetPlatform being built * @param InConfiguration The UnrealTargetConfiguration being built * * @return string The name of the platform that VisualStudio recognizes */ public override string GetVisualStudioPlatformName(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration) { if (InPlatform == UnrealTargetPlatform.WinRT) { return "WinRT"; } return InPlatform.ToString(); }
public override List<UnrealTargetPlatform> GUBP_GetPlatforms_MonolithicOnly(UnrealTargetPlatform HostPlatform) { if (HostPlatform == UnrealTargetPlatform.Mac) { return new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.IOS }; } return new List<UnrealTargetPlatform> { HostPlatform, UnrealTargetPlatform.Win32, UnrealTargetPlatform.IOS, UnrealTargetPlatform.XboxOne, UnrealTargetPlatform.PS4, UnrealTargetPlatform.Android }; }
/// <summary> /// Gets the standard path for an manifest /// </summary> /// <param name="DirectoryName">The directory containing this manifest</param> /// <param name="AppName">The modular app name being built</param> /// <param name="Configuration">The target configuration</param> /// <param name="Platform">The target platform</param> /// <param name="BuildArchitecture">The architecture of the target platform</param> /// <returns>Filename for the app receipt</returns> public static string GetStandardFileName(string AppName, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, string BuildArchitecture, bool bIsGameDirectory) { string BaseName = AppName; if(Configuration != UnrealTargetConfiguration.Development && !(Configuration == UnrealTargetConfiguration.DebugGame && !bIsGameDirectory)) { BaseName += String.Format("-{0}-{1}", Platform.ToString(), Configuration.ToString()); } return String.Format("{0}{1}.modules", BaseName, BuildArchitecture); }
/// <summary> /// Constructs a TargetInfo /// </summary> /// <param name="InitPlatform">Target platform</param> /// <param name="InitConfiguration">Target build configuration</param> public TargetInfo( UnrealTargetPlatform InitPlatform, UnrealTargetConfiguration InitConfiguration ) { Platform = InitPlatform; Configuration = InitConfiguration; // get the platform's architecture var BuildPlatform = UEBuildPlatform.GetBuildPlatform(Platform); Architecture = BuildPlatform.GetActiveArchitecture(); }
public override void AddNodes(GUBP bp, GUBP.GUBPBranchConfig BranchConfig, UnrealTargetPlatform InHostPlatform, List<UnrealTargetPlatform> InActivePlatforms) { /* if(InHostPlatform == UnrealTargetPlatform.Win64 && !BranchConfig.BranchOptions.bNoDocumentation) { BranchConfig.AddNode(new ToolsForDocumentationNode(BranchConfig, InHostPlatform)); BranchConfig.AddNode(new CodeDocumentationNode(InHostPlatform)); BranchConfig.AddNode(new BlueprintDocumentationNode(InHostPlatform)); }*/ }
/** * Retrieve the CPPTargetPlatform for the given UnrealTargetPlatform * * @param InUnrealTargetPlatform The UnrealTargetPlatform being build * * @return CPPTargetPlatform The CPPTargetPlatform to compile for */ public override CPPTargetPlatform GetCPPTargetPlatform(UnrealTargetPlatform InUnrealTargetPlatform) { switch (InUnrealTargetPlatform) { case UnrealTargetPlatform.Mac: return CPPTargetPlatform.Mac; } throw new BuildException("MacPlatform::GetCPPTargetPlatform: Invalid request for {0}", InUnrealTargetPlatform.ToString()); }
public override bool ShouldCompileMonolithic(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration) { if (UnrealBuildTool.UnrealBuildTool.CommandLineContains("-monolithic") == true) { return true; } // Don't build monolithic because we want plugin support return false; }
// when the host is win64, this is win32 because those are also "host platforms" public static UnrealTargetPlatform GetAltHostPlatform(UnrealTargetPlatform HostPlatform) { UnrealTargetPlatform AltHostPlatform = UnrealTargetPlatform.Unknown; // when the host is win64, this is win32 because those are also "host platforms" if (HostPlatform == UnrealTargetPlatform.Win64) { AltHostPlatform = UnrealTargetPlatform.Win32; } return AltHostPlatform; }
/** * Retrieve the UEBuildDeploy instance for the given TargetPlatform * * @param InPlatform The UnrealTargetPlatform being built * * @return UEBuildDeploy The instance of the build deploy */ public static UEBuildDeploy GetBuildDeploy(UnrealTargetPlatform InPlatform) { if (BuildDeployDictionary.ContainsKey(InPlatform) == true) { return BuildDeployDictionary[InPlatform]; } // A platform does not *have* to have a deployment handler... return null; }
static void AddPluginToAgenda(UE4Build.BuildAgenda Agenda, string PluginFileName, PluginDescriptor Plugin, string TargetName, TargetRules.TargetType TargetType, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, List <string> ReceiptFileNames, string InAdditionalArgs) { // Find a list of modules that need to be built for this plugin List <string> ModuleNames = new List <string>(); foreach (ModuleDescriptor Module in Plugin.Modules) { if (Module.IsCompiledInConfiguration(Platform, TargetType)) { ModuleNames.Add(Module.Name); } } // Add these modules to the build agenda if (ModuleNames.Count > 0) { string Arguments = String.Format("-plugin {0}", CommandUtils.MakePathSafeToUseWithCommandLine(PluginFileName)); foreach (string ModuleName in ModuleNames) { Arguments += String.Format(" -module {0}", ModuleName); } string ReceiptFileName = BuildReceipt.GetDefaultPath(Path.GetDirectoryName(PluginFileName), TargetName, Platform, Configuration, ""); Arguments += String.Format(" -receipt {0}", CommandUtils.MakePathSafeToUseWithCommandLine(ReceiptFileName)); ReceiptFileNames.Add(ReceiptFileName); if (!String.IsNullOrEmpty(InAdditionalArgs)) { Arguments += InAdditionalArgs; } Agenda.AddTarget(TargetName, Platform, Configuration, InAddArgs: Arguments); } }
void CompilePluginWithUBT(FileReference HostProjectFile, FileReference HostProjectPluginFile, PluginDescriptor Plugin, string TargetName, TargetType TargetType, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, List <FileReference> ManifestFileNames, string InAdditionalArgs) { // Find a list of modules that need to be built for this plugin bool bCompilePlatform = false; if (Plugin.Modules != null) { foreach (ModuleDescriptor Module in Plugin.Modules) { bool bBuildDeveloperTools = (TargetType == TargetType.Editor || TargetType == TargetType.Program); bool bBuildRequiresCookedData = (TargetType != TargetType.Editor && TargetType != TargetType.Program); if (Module.IsCompiledInConfiguration(Platform, Configuration, TargetName, TargetType, bBuildDeveloperTools, bBuildRequiresCookedData)) { bCompilePlatform = true; } } } // Add these modules to the build agenda if (bCompilePlatform) { FileReference ManifestFileName = FileReference.Combine(HostProjectFile.Directory, "Saved", String.Format("Manifest-{0}-{1}-{2}.xml", TargetName, Platform, Configuration)); ManifestFileNames.Add(ManifestFileName); string Arguments = String.Format("-plugin={0} -iwyu -noubtmakefiles -manifest={1} -nohotreload", CommandUtils.MakePathSafeToUseWithCommandLine(HostProjectPluginFile.FullName), CommandUtils.MakePathSafeToUseWithCommandLine(ManifestFileName.FullName)); if (Platform == UnrealTargetPlatform.Android) { Arguments += String.Format(" -architectures={0}", AndroidArchitectures); } else if (Platform == UnrealTargetPlatform.HoloLens) { Arguments += String.Format(" -Architecture={0}", HoloLensArchitecture); } if (!String.IsNullOrEmpty(InAdditionalArgs)) { Arguments += InAdditionalArgs; } CommandUtils.RunUBT(CmdEnv, UE4Build.GetUBTExecutable(), HostProjectFile, TargetName, Platform, Configuration, Arguments); } }
public override void ExecuteBuild() { // Parse the target list string[] Targets = ParseParamValues("Target"); if (Targets.Length == 0) { throw new AutomationException("No targets specified (eg. -Target=\"UE4Editor Win64 Development\")"); } // Parse the archive path string ArchivePath = ParseParamValue("Archive"); if (ArchivePath != null && (!ArchivePath.StartsWith("//") || ArchivePath.Sum(x => (x == '/')? 1 : 0) < 4)) { throw new AutomationException("Archive path is not a valid depot filename"); } // Parse the stream name string StreamName = ParseParamValue("Stream"); if (StreamName == null && ArchivePath != null) { StreamName = ArchivePath.Substring(0, ArchivePath.IndexOf('/', ArchivePath.IndexOf('/', 2) + 1)); } // Prepare the build agenda UE4Build.BuildAgenda Agenda = new UE4Build.BuildAgenda(); foreach (string Target in Targets) { string[] Tokens = Target.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); UnrealTargetConfiguration Configuration = UnrealTargetConfiguration.Unknown; UnrealTargetPlatform Platform; if (Tokens.Length < 3 || !UnrealTargetPlatform.TryParse(Tokens[1], out Platform) || !Enum.TryParse(Tokens[2], true, out Configuration)) { throw new AutomationException("Invalid target '{0}' - expected <TargetName> <Platform> <Configuration>"); } Agenda.AddTarget(Tokens[0], Platform, Configuration, InAddArgs: String.Join(" ", Tokens.Skip(3))); } // Build everything UE4Build Builder = new UE4Build(this); Builder.Build(Agenda, InUpdateVersionFiles: ArchivePath != null); // Include the build products for UAT and UBT if required if (ParseParam("WithUAT")) { Builder.AddUATFilesToBuildProducts(); } if (ParseParam("WithUBT")) { Builder.AddUBTFilesToBuildProducts(); } // Archive the build products if (ArchivePath != null) { // Create an output folder string OutputFolder = Path.Combine(CommandUtils.CmdEnv.LocalRoot, "ArchiveForUGS"); Directory.CreateDirectory(OutputFolder); // Create a temp folder for storing stripped PDB files string SymbolsFolder = Path.Combine(OutputFolder, "Symbols"); Directory.CreateDirectory(SymbolsFolder); // Get the Windows toolchain Platform WindowsTargetPlatform = Platform.GetPlatform(UnrealTargetPlatform.Win64); // Figure out all the files for the archive string ZipFileName = Path.Combine(OutputFolder, "Archive.zip"); using (Ionic.Zip.ZipFile Zip = new Ionic.Zip.ZipFile()) { Zip.UseZip64WhenSaving = Ionic.Zip.Zip64Option.AsNecessary; foreach (string BuildProduct in Builder.BuildProductFiles) { if (!File.Exists(BuildProduct)) { throw new AutomationException("Missing build product: {0}", BuildProduct); } if (BuildProduct.EndsWith(".pdb", StringComparison.InvariantCultureIgnoreCase)) { string StrippedFileName = CommandUtils.MakeRerootedFilePath(BuildProduct, CommandUtils.CmdEnv.LocalRoot, SymbolsFolder); Directory.CreateDirectory(Path.GetDirectoryName(StrippedFileName)); WindowsTargetPlatform.StripSymbols(new FileReference(BuildProduct), new FileReference(StrippedFileName)); Zip.AddFile(StrippedFileName, Path.GetDirectoryName(CommandUtils.StripBaseDirectory(StrippedFileName, SymbolsFolder))); } else { Zip.AddFile(BuildProduct, Path.GetDirectoryName(CommandUtils.StripBaseDirectory(BuildProduct, CommandUtils.CmdEnv.LocalRoot))); } } // Create the zip file Console.WriteLine("Writing {0}...", ZipFileName); Zip.Save(ZipFileName); } // Submit it to Perforce if required if (CommandUtils.AllowSubmit) { // Delete any existing clientspec for submitting string ClientName = Environment.MachineName + "_BuildForUGS"; // Create a brand new one P4ClientInfo Client = new P4ClientInfo(); Client.Owner = CommandUtils.P4Env.User; Client.Host = Environment.MachineName; Client.Stream = StreamName; Client.RootPath = Path.Combine(OutputFolder, "Perforce"); Client.Name = ClientName; Client.Options = P4ClientOption.NoAllWrite | P4ClientOption.NoClobber | P4ClientOption.NoCompress | P4ClientOption.Unlocked | P4ClientOption.NoModTime | P4ClientOption.RmDir; Client.LineEnd = P4LineEnd.Local; P4.CreateClient(Client, AllowSpew: false); // Create a new P4 connection for this workspace P4Connection SubmitP4 = new P4Connection(Client.Owner, Client.Name, P4Env.ServerAndPort); SubmitP4.Revert("-k //..."); // Figure out where the zip file has to go in Perforce P4WhereRecord WhereZipFile = SubmitP4.Where(ArchivePath, false).FirstOrDefault(x => !x.bUnmap && x.Path != null); if (WhereZipFile == null) { throw new AutomationException("Couldn't locate {0} in this workspace"); } // Get the latest version of it int NewCL = SubmitP4.CreateChange(Description: String.Format("[CL {0}] Updated binaries", P4Env.Changelist)); SubmitP4.Sync(String.Format("-k \"{0}\"", ArchivePath), AllowSpew: false); CommandUtils.CopyFile(ZipFileName, WhereZipFile.Path); SubmitP4.Add(NewCL, String.Format("\"{0}\"", ArchivePath)); SubmitP4.Edit(NewCL, String.Format("\"{0}\"", ArchivePath)); // Submit it int SubmittedCL; SubmitP4.Submit(NewCL, out SubmittedCL); if (SubmittedCL <= 0) { throw new AutomationException("Submit failed."); } Console.WriteLine("Submitted in changelist {0}", SubmittedCL); } } }
private static ProcessResult RunDedicatedServer(ProjectParams Params, string ServerLogFile, string AdditionalCommandLine) { ProjectParams ServerParams = new ProjectParams(Params); ServerParams.Device = Params.ServerDevice; if (ServerParams.ServerTargetPlatforms.Count == 0) { throw new AutomationException("No ServerTargetPlatform set for RunDedicatedServer."); } var DeployContextList = CreateDeploymentContext(ServerParams, true); if (DeployContextList.Count == 0) { throw new AutomationException("No DeployContextList for RunDedicatedServer."); } var SC = DeployContextList[0]; var ServerApp = CombinePaths(CmdEnv.LocalRoot, "Engine/Binaries/Win64/UE4Editor.exe"); if (ServerParams.Cook) { List <string> Exes = SC.StageTargetPlatform.GetExecutableNames(SC); ServerApp = Exes[0]; } var Args = ServerParams.Cook ? "" : (SC.ProjectArgForCommandLines + " "); Console.WriteLine(Params.ServerDeviceAddress); UnrealTargetPlatform ServerPlatform = ServerParams.ServerTargetPlatforms[0]; if (ServerParams.Cook && ServerPlatform == UnrealTargetPlatform.Linux && !String.IsNullOrEmpty(ServerParams.ServerDeviceAddress)) { ServerApp = @"C:\Windows\system32\cmd.exe"; string plinkPath = CombinePaths(Environment.GetEnvironmentVariable("LINUX_ROOT"), "bin/PLINK.exe "); string exePath = CombinePaths(SC.ShortProjectName, "Binaries", ServerPlatform.ToString(), SC.ShortProjectName + "Server"); if (ServerParams.ServerConfigsToBuild[0] != UnrealTargetConfiguration.Development) { exePath += "-" + ServerPlatform.ToString() + "-" + ServerParams.ServerConfigsToBuild[0].ToString(); } exePath = CombinePaths("LinuxServer", exePath.ToLower()).Replace("\\", "/"); Args = String.Format("/k {0} -batch -ssh -t -i {1} {2}@{3} {4} {5} {6} -server -Messaging", plinkPath, ServerParams.DevicePassword, ServerParams.DeviceUsername, ServerParams.ServerDeviceAddress, exePath, Args, ServerParams.MapToRun); } else { var Map = ServerParams.MapToRun; if (!String.IsNullOrEmpty(ServerParams.AdditionalServerMapParams)) { Map += ServerParams.AdditionalServerMapParams; } if (Params.FakeClient) { Map += "?fake"; } Args += String.Format("{0} -server -abslog={1} -unattended -FORCELOGFLUSH -log -Messaging -nomcp", Map, CommandUtils.MakePathSafeToUseWithCommandLine(ServerLogFile)); } if (ServerParams.UsePak(SC.StageTargetPlatform) || ServerParams.SignedPak) { if (ServerParams.SignedPak) { Args += " -signedpak"; } else { Args += " -pak"; } } if (IsBuildMachine || Params.Unattended) { Args += " -buildmachine"; } Args += " -CrashForUAT"; Args += " " + AdditionalCommandLine; if (ServerParams.Cook && ServerPlatform == UnrealTargetPlatform.Linux && !String.IsNullOrEmpty(ServerParams.ServerDeviceAddress)) { Args += String.Format(" 2>&1 > {0}", ServerLogFile); } PushDir(Path.GetDirectoryName(ServerApp)); var Result = Run(ServerApp, Args, null, ERunOptions.AllowSpew | ERunOptions.NoWaitForExit | ERunOptions.AppMustExist | ERunOptions.NoStdOutRedirect); PopDir(); return(Result); }
/// <summary> /// Attempts to autodetect project properties. /// </summary> /// <param name="RawProjectPath">Full project path.</param> /// <returns>Project properties.</returns> private static ProjectProperties DetectProjectProperties(FileReference RawProjectPath, List <UnrealTargetPlatform> ClientTargetPlatforms, List <UnrealTargetConfiguration> ClientTargetConfigurations, bool AssetNativizationRequested) { ProjectProperties Properties = new ProjectProperties(); Properties.RawProjectPath = RawProjectPath; // detect if the project is content only, but has non-default build settings List <string> ExtraSearchPaths = null; if (RawProjectPath != null) { string TempTargetDir = CommandUtils.CombinePaths(Path.GetDirectoryName(RawProjectPath.FullName), "Intermediate", "Source"); if (RequiresTempTarget(RawProjectPath, ClientTargetPlatforms, ClientTargetConfigurations, AssetNativizationRequested)) { GenerateTempTarget(RawProjectPath); Properties.bWasGenerated = true; ExtraSearchPaths = new List <string>(); ExtraSearchPaths.Add(TempTargetDir); } else if (File.Exists(Path.Combine(Path.GetDirectoryName(RawProjectPath.FullName), "Intermediate", "Source", Path.GetFileNameWithoutExtension(RawProjectPath.FullName) + ".Target.cs"))) { File.Delete(Path.Combine(Path.GetDirectoryName(RawProjectPath.FullName), "Intermediate", "Source", Path.GetFileNameWithoutExtension(RawProjectPath.FullName) + ".Target.cs")); } // in case the RulesCompiler (what we use to find all the // Target.cs files) has already cached the contents of this // directory, then we need to invalidate that cache (so // it'll find/use the new Target.cs file) RulesCompiler.InvalidateRulesFileCache(TempTargetDir); } if (CommandUtils.CmdEnv.HasCapabilityToCompile) { DetectTargetsForProject(Properties, ExtraSearchPaths); Properties.bIsCodeBasedProject = !CommandUtils.IsNullOrEmpty(Properties.Targets) || !CommandUtils.IsNullOrEmpty(Properties.Programs); } else { // should never ask for engine targets if we can't compile if (RawProjectPath == null) { throw new AutomationException("Cannot determine engine targets if we can't compile."); } Properties.bIsCodeBasedProject = Properties.bWasGenerated; // if there's a Source directory with source code in it, then mark us as having source code string SourceDir = CommandUtils.CombinePaths(Path.GetDirectoryName(RawProjectPath.FullName), "Source"); if (Directory.Exists(SourceDir)) { string[] CppFiles = Directory.GetFiles(SourceDir, "*.cpp", SearchOption.AllDirectories); string[] HFiles = Directory.GetFiles(SourceDir, "*.h", SearchOption.AllDirectories); Properties.bIsCodeBasedProject |= (CppFiles.Length > 0 || HFiles.Length > 0); } } // check to see if the uproject loads modules, only if we haven't already determined it is a code based project if (!Properties.bIsCodeBasedProject && RawProjectPath != null) { string uprojectStr = File.ReadAllText(RawProjectPath.FullName); Properties.bIsCodeBasedProject = uprojectStr.Contains("\"Modules\""); } // Get all ini files if (RawProjectPath != null) { CommandUtils.LogVerbose("Loading ini files for {0}", RawProjectPath); foreach (UnrealTargetPlatform TargetPlatformType in UnrealTargetPlatform.GetValidPlatforms()) { ConfigHierarchy EngineConfig = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, RawProjectPath.Directory, TargetPlatformType); Properties.EngineConfigs.Add(TargetPlatformType, EngineConfig); ConfigHierarchy GameConfig = ConfigCache.ReadHierarchy(ConfigHierarchyType.Game, RawProjectPath.Directory, TargetPlatformType); Properties.GameConfigs.Add(TargetPlatformType, GameConfig); } } return(Properties); }
public override List <UnrealTargetConfiguration> GUBP_GetConfigsForPrecompiledBuilds_MonolithicOnly(UnrealTargetPlatform HostPlatform, UnrealTargetPlatform Platform) { List <UnrealTargetConfiguration> Platforms = new List <UnrealTargetConfiguration>(); if (HostPlatform == UnrealTargetPlatform.Mac) { if (Platform == UnrealTargetPlatform.Mac || Platform == UnrealTargetPlatform.IOS) { Platforms.Add(UnrealTargetConfiguration.Development); Platforms.Add(UnrealTargetConfiguration.Shipping); } } else if (HostPlatform == UnrealTargetPlatform.Win64) { if (Platform == UnrealTargetPlatform.Win32 || Platform == UnrealTargetPlatform.Win64 || Platform == UnrealTargetPlatform.Android || Platform == UnrealTargetPlatform.HTML5) { Platforms.Add(UnrealTargetConfiguration.Development); Platforms.Add(UnrealTargetConfiguration.Shipping); } } return(Platforms); }
/// <summary> /// Only relevant for the mac and PC at the moment. Example calling the Mac platform with PS4 as an arg will return false. Can't compile or cook for the PS4 on the mac. /// </summary> public virtual bool CanHostPlatform(UnrealTargetPlatform Platform) { return(false); }
void CompilePluginWithUBT(FileReference HostProjectFile, FileReference HostProjectPluginFile, PluginDescriptor Plugin, string TargetName, TargetRules.TargetType TargetType, UnrealTargetPlatform Platform, UnrealTargetConfiguration Configuration, List <string> ReceiptFileNames, string InAdditionalArgs) { // Find a list of modules that need to be built for this plugin List <string> ModuleNames = new List <string>(); foreach (ModuleDescriptor Module in Plugin.Modules) { bool bBuildDeveloperTools = (TargetType == TargetRules.TargetType.Editor || TargetType == TargetRules.TargetType.Program); bool bBuildEditor = (TargetType == TargetRules.TargetType.Editor); if (Module.IsCompiledInConfiguration(Platform, TargetType, bBuildDeveloperTools, bBuildEditor)) { ModuleNames.Add(Module.Name); } } // Add these modules to the build agenda if (ModuleNames.Count > 0) { string Arguments = ""; // String.Format("-plugin {0}", CommandUtils.MakePathSafeToUseWithCommandLine(PluginFile.FullName)); foreach (string ModuleName in ModuleNames) { Arguments += String.Format(" -module {0}", ModuleName); } string Architecture = UEBuildPlatform.GetBuildPlatform(Platform).CreateContext(HostProjectFile).GetActiveArchitecture(); string ReceiptFileName = TargetReceipt.GetDefaultPath(HostProjectPluginFile.Directory.FullName, TargetName, Platform, Configuration, Architecture); Arguments += String.Format(" -receipt {0}", CommandUtils.MakePathSafeToUseWithCommandLine(ReceiptFileName)); ReceiptFileNames.Add(ReceiptFileName); if (!String.IsNullOrEmpty(InAdditionalArgs)) { Arguments += InAdditionalArgs; } CommandUtils.RunUBT(CmdEnv, UE4Build.GetUBTExecutable(), String.Format("{0} {1} {2}{3} {4}", TargetName, Platform, Configuration, (HostProjectFile == null)? "" : String.Format(" -project=\"{0}\"", HostProjectFile.FullName), Arguments)); } }
public override void ExecuteBuild() { // Get the plugin filename string PluginFileName = ParseParamValue("Plugin"); if (PluginFileName == null) { throw new AutomationException("Plugin file name was not specified via the -plugin argument"); } // Read the plugin PluginDescriptor Plugin = PluginDescriptor.FromFile(PluginFileName); // Clean the intermediate build directory string IntermediateBuildDirectory = Path.Combine(Path.GetDirectoryName(PluginFileName), "Intermediate", "Build"); if (CommandUtils.DirectoryExists(IntermediateBuildDirectory)) { CommandUtils.DeleteDirectory(IntermediateBuildDirectory); } // Get any additional arguments from the commandline string AdditionalArgs = ""; if (ParseParam("Rocket")) { AdditionalArgs += " -Rocket"; } // Build the host platforms List <string> ReceiptFileNames = new List <string>(); UE4Build.BuildAgenda Agenda = new UE4Build.BuildAgenda(); UnrealTargetPlatform HostPlatform = BuildHostPlatform.Current.Platform; if (!ParseParam("NoHostPlatform")) { AddPluginToAgenda(Agenda, PluginFileName, Plugin, "UE4Editor", TargetRules.TargetType.Editor, HostPlatform, UnrealTargetConfiguration.Development, ReceiptFileNames, AdditionalArgs); } // Add the game targets List <UnrealTargetPlatform> TargetPlatforms = Rocket.RocketBuild.GetTargetPlatforms(this, HostPlatform); foreach (UnrealTargetPlatform TargetPlatform in TargetPlatforms) { if (Rocket.RocketBuild.IsCodeTargetPlatform(HostPlatform, TargetPlatform)) { AddPluginToAgenda(Agenda, PluginFileName, Plugin, "UE4Game", TargetRules.TargetType.Game, TargetPlatform, UnrealTargetConfiguration.Development, ReceiptFileNames, AdditionalArgs); AddPluginToAgenda(Agenda, PluginFileName, Plugin, "UE4Game", TargetRules.TargetType.Game, TargetPlatform, UnrealTargetConfiguration.Shipping, ReceiptFileNames, AdditionalArgs); } } // Build it UE4Build Build = new UE4Build(this); Build.Build(Agenda, InDeleteBuildProducts: true, InUpdateVersionFiles: false); // Package the plugin to the output folder string PackageDirectory = ParseParamValue("Package"); if (PackageDirectory != null) { List <BuildProduct> BuildProducts = GetBuildProductsFromReceipts(ReceiptFileNames); PackagePlugin(PluginFileName, BuildProducts, PackageDirectory); } }
public BaseLinuxPlatform(UnrealTargetPlatform P) : base(P) { }
public override GUBPProjectOptions GUBP_IncludeProjectInPromotedBuild_EditorTypeOnly(UnrealTargetPlatform HostPlatform) { var Result = new GUBPProjectOptions(); Result.bIsPromotable = true; return(Result); }
public TargetPlatformData(UnrealTargetPlatform InPlatform) { Platform = InPlatform; // Linux never has an empty architecture. If we don't care then it's x86_64-unknown-linux-gnu Architecture = (Platform == UnrealTargetPlatform.Linux) ? "x86_64-unknown-linux-gnu" : ""; }
public override List <GUBPFormalBuild> GUBP_GetConfigsForFormalBuilds_MonolithicOnly(UnrealTargetPlatform HostPlatform) { if (HostPlatform != UnrealTargetPlatform.Mac) { return(new List <GUBPFormalBuild>()); } else { return(new List <GUBPFormalBuild> { new GUBPFormalBuild(UnrealTargetPlatform.IOS, UnrealTargetConfiguration.Development), new GUBPFormalBuild(UnrealTargetPlatform.IOS, UnrealTargetConfiguration.Shipping), new GUBPFormalBuild(UnrealTargetPlatform.IOS, UnrealTargetConfiguration.Test, false, true), }); } }
public static Platform GetPlatform(UnrealTargetPlatform PlatformType, string CookFlavor) { TargetPlatformDescriptor Desc = new TargetPlatformDescriptor(PlatformType, CookFlavor); return(AllPlatforms[Desc]); }
public static Platform GetPlatform(UnrealTargetPlatform PlatformType) { TargetPlatformDescriptor Desc = new TargetPlatformDescriptor(PlatformType); return(AllPlatforms[Desc]); }
public TargetPlatformDescriptor(UnrealTargetPlatform InType) { Type = InType; CookFlavor = ""; }
public Platform(UnrealTargetPlatform PlatformType) { TargetPlatformType = PlatformType; TargetIniPlatformType = PlatformType; }
public override List <UnrealTargetConfiguration> GUBP_GetConfigs_MonolithicOnly(UnrealTargetPlatform HostPlatform, UnrealTargetPlatform Platform) { return(new List <UnrealTargetConfiguration> { UnrealTargetConfiguration.Development, UnrealTargetConfiguration.Shipping, UnrealTargetConfiguration.Test }); }
public TargetPlatformDescriptor(UnrealTargetPlatform InType, string InCookFlavor) { Type = InType; CookFlavor = InCookFlavor; }
/// <summary> /// Returns a path to the client binaries folder. /// </summary> /// <param name="RawProjectPath">Full project path.</param> /// <param name="Platform">Platform type.</param> /// <returns>Path to the binaries folder.</returns> public static DirectoryReference GetProjectClientBinariesFolder(DirectoryReference ProjectClientBinariesPath, UnrealTargetPlatform Platform) { ProjectClientBinariesPath = DirectoryReference.Combine(ProjectClientBinariesPath, Platform.ToString()); return(ProjectClientBinariesPath); }
public BaseWinPlatform(UnrealTargetPlatform P) : base(P) { }
private static bool RequiresTempTarget(FileReference RawProjectPath, List <UnrealTargetPlatform> ClientTargetPlatforms, List <UnrealTargetConfiguration> ClientTargetConfigurations, bool AssetNativizationRequested, out string Reason) { // check to see if we already have a Target.cs file if (File.Exists(Path.Combine(Path.GetDirectoryName(RawProjectPath.FullName), "Source", RawProjectPath.GetFileNameWithoutExtension() + ".Target.cs"))) { Reason = null; return(false); } else if (Directory.Exists(Path.Combine(Path.GetDirectoryName(RawProjectPath.FullName), "Source"))) { // wasn't one in the main Source directory, let's check all sub-directories //@todo: may want to read each target.cs to see if it has a target corresponding to the project name as a final check FileInfo[] Files = (new DirectoryInfo(Path.Combine(Path.GetDirectoryName(RawProjectPath.FullName), "Source")).GetFiles("*.Target.cs", SearchOption.AllDirectories)); if (Files.Length > 0) { Reason = null; return(false); } } // // once we reach this point, we can surmise that this is an asset- // only (code free) project if (AssetNativizationRequested) { // we're going to be converting some of the project's assets // into native code, so we require a distinct target (executable) // be generated for this project Reason = "asset nativization is enabled"; return(true); } if (ClientTargetPlatforms != null) { foreach (UnrealTargetPlatform ClientPlatform in ClientTargetPlatforms) { EncryptionAndSigning.CryptoSettings Settings = EncryptionAndSigning.ParseCryptoSettings(RawProjectPath.Directory, ClientPlatform); if (Settings.IsAnyEncryptionEnabled() || Settings.IsPakSigningEnabled()) { Reason = "encryption/signing is enabled"; return(true); } } } // no Target file, now check to see if build settings have changed List <UnrealTargetPlatform> TargetPlatforms = ClientTargetPlatforms; if (ClientTargetPlatforms == null || ClientTargetPlatforms.Count < 1) { // No client target platforms, add all in TargetPlatforms = new List <UnrealTargetPlatform>(); foreach (UnrealTargetPlatform TargetPlatformType in UnrealTargetPlatform.GetValidPlatforms()) { TargetPlatforms.Add(TargetPlatformType); } } List <UnrealTargetConfiguration> TargetConfigurations = ClientTargetConfigurations; if (TargetConfigurations == null || TargetConfigurations.Count < 1) { // No client target configurations, add all in TargetConfigurations = new List <UnrealTargetConfiguration>(); foreach (UnrealTargetConfiguration TargetConfigurationType in Enum.GetValues(typeof(UnrealTargetConfiguration))) { if (TargetConfigurationType != UnrealTargetConfiguration.Unknown) { TargetConfigurations.Add(TargetConfigurationType); } } } // Read the project descriptor, and find all the plugins available to this project ProjectDescriptor Project = ProjectDescriptor.FromFile(RawProjectPath); List <PluginInfo> AvailablePlugins = Plugins.ReadAvailablePlugins(CommandUtils.EngineDirectory, RawProjectPath, Project.AdditionalPluginDirectories); // check the target platforms for any differences in build settings or additional plugins foreach (UnrealTargetPlatform TargetPlatformType in TargetPlatforms) { if (!CommandUtils.IsEngineInstalled() && !PlatformExports.HasDefaultBuildConfig(RawProjectPath, TargetPlatformType)) { Reason = "project has non-default build configuration"; return(true); } if (PlatformExports.RequiresBuild(RawProjectPath, TargetPlatformType)) { Reason = "overriden by target platform"; return(true); } // find if there are any plugins enabled or disabled which differ from the default foreach (PluginInfo Plugin in AvailablePlugins) { bool bPluginEnabledForTarget = false; foreach (UnrealTargetConfiguration TargetConfigType in TargetConfigurations) { bPluginEnabledForTarget |= Plugins.IsPluginEnabledForProject(Plugin, Project, TargetPlatformType, TargetConfigType, TargetRules.TargetType.Game); } bool bPluginEnabledForBaseTarget = false; if (!Plugin.Descriptor.bInstalled) { foreach (UnrealTargetConfiguration TargetConfigType in TargetConfigurations) { bPluginEnabledForBaseTarget |= Plugins.IsPluginEnabledForProject(Plugin, null, TargetPlatformType, TargetConfigType, TargetRules.TargetType.Game); } } if (bPluginEnabledForTarget != bPluginEnabledForBaseTarget) { if (bPluginEnabledForTarget) { Reason = String.Format("{0} plugin is enabled", Plugin.Name); return(true); } else { Reason = String.Format("{0} plugin is disabled", Plugin.Name); return(true); } } } } Reason = null; return(false); }
public bool CanSupportPlatform(UnrealTargetPlatform InPlatform) { return(InPlatform == UnrealTargetPlatform.Android); }
public override bool ShouldCompileMonolithic(UnrealTargetPlatform InPlatform, UnrealTargetConfiguration InConfiguration) { return(true); }
void TestClientPlatform(UnrealTargetPlatform Platform) { string GameName = this.GameName; string BuildPath = this.BuildPath; string DevKit = this.DevkitName; if (GameName.Equals("OrionGame", StringComparison.OrdinalIgnoreCase) == false) { Log.Info("Skipping test {0} due to non-Orion project!", this); MarkComplete(); return; } // create a new build UnrealBuildSource Build = new UnrealBuildSource(GameName, UsesSharedBuildType, Environment.CurrentDirectory, BuildPath); // check it's valid if (!CheckResult(Build.BuildCount > 0, "staged build was invalid")) { MarkComplete(); return; } // Create devices to run the client and server ITargetDevice ServerDevice = new TargetDeviceWindows("PC Server", Gauntlet.Globals.TempDir); ITargetDevice ClientDevice = null; if (Platform == UnrealTargetPlatform.PS4) { //ClientDevice = new TargetDevicePS4(this.PS4Name); } else { ClientDevice = new TargetDeviceWindows("PC Client", Gauntlet.Globals.TempDir); } UnrealAppConfig ServerConfig = Build.CreateConfiguration(new UnrealSessionRole(UnrealTargetRole.Server, ServerDevice.Platform, UnrealTargetConfiguration.Development)); UnrealAppConfig ClientConfig = Build.CreateConfiguration(new UnrealSessionRole(UnrealTargetRole.Client, ClientDevice.Platform, UnrealTargetConfiguration.Development)); if (!CheckResult(ServerConfig != null && ServerConfig != null, "Could not create configs!")) { MarkComplete(); return; } ShortSoloOptions Options = new ShortSoloOptions(); Options.ApplyToConfig(ClientConfig); Options.ApplyToConfig(ServerConfig); IAppInstall ClientInstall = ClientDevice.InstallApplication(ClientConfig); IAppInstall ServerInstall = ServerDevice.InstallApplication(ServerConfig); if (!CheckResult(ServerConfig != null && ServerConfig != null, "Could not create configs!")) { MarkComplete(); return; } IAppInstance ClientInstance = ClientInstall.Run(); IAppInstance ServerInstance = ServerInstall.Run(); DateTime StartTime = DateTime.Now; bool RunWasSuccessful = true; while (ClientInstance.HasExited == false) { if ((DateTime.Now - StartTime).TotalSeconds > 800) { RunWasSuccessful = false; break; } } ClientInstance.Kill(); ServerInstance.Kill(); UnrealLogParser LogParser = new UnrealLogParser(ClientInstance.StdOut); UnrealLogParser.CallstackMessage ErrorInfo = LogParser.GetFatalError(); if (ErrorInfo != null) { CheckResult(false, "FatalError - {0}", ErrorInfo.Message); } RunWasSuccessful = LogParser.HasRequestExit(); CheckResult(RunWasSuccessful, "Failed to run for platform {0}", Platform); }
public override List <GUBPFormalBuild> GUBP_GetConfigsForFormalBuilds_MonolithicOnly(UnrealTargetPlatform HostPlatform) { if (HostPlatform == UnrealTargetPlatform.Win64) { return(new List <GUBPFormalBuild> { new GUBPFormalBuild(UnrealTargetPlatform.Win64, UnrealTargetConfiguration.Development), new GUBPFormalBuild(UnrealTargetPlatform.Linux, UnrealTargetConfiguration.Development), }); } else { return(new List <GUBPFormalBuild>()); } }
public override void ExecuteBuild() { // Get the list of platform names string[] FeaturePacks = ParseParamValue("FeaturePacks").Split(';'); string TempDir = ParseParamValue("TempDir"); UnrealTargetPlatform HostPlatform = BuildHostPlatform.Current.Platform; string TargetPlatforms = ParseParamValue("TargetPlatforms"); string SavedDir = ParseParamValue("SavedDir"); string BackendName = ParseParamValue("BackendName", "CreateInstalledEnginePak"); string RelativePakPath = ParseParamValue("RelativePakPath", "Engine/DerivedDataCache/Compressed.ddp"); bool bSkipEngine = ParseParam("SkipEngine"); // Get paths to everything within the temporary directory string EditorExe = CommandUtils.GetEditorCommandletExe(TempDir, HostPlatform); string OutputPakFile = CommandUtils.CombinePaths(TempDir, RelativePakPath); string OutputCsvFile = Path.ChangeExtension(OutputPakFile, ".csv"); List <string> ProjectPakFiles = new List <string>(); List <string> FeaturePackPaths = new List <string>(); // loop through all the projects first and bail out if one of them doesn't exist. foreach (string FeaturePack in FeaturePacks) { if (!String.IsNullOrWhiteSpace(FeaturePack)) { string FeaturePackPath = CommandUtils.CombinePaths(CommandUtils.RootDirectory.FullName, FeaturePack); if (!CommandUtils.FileExists(FeaturePackPath)) { throw new AutomationException("Could not find project: " + FeaturePack); } FeaturePackPaths.Add(FeaturePackPath); } } // loop through all the paths and generate ddc data for them foreach (string FeaturePackPath in FeaturePackPaths) { string ProjectSpecificPlatforms = TargetPlatforms; FileReference FileRef = new FileReference(FeaturePackPath); string GameName = FileRef.GetFileNameWithoutAnyExtensions(); ProjectDescriptor Project = ProjectDescriptor.FromFile(FileRef); if (Project.TargetPlatforms != null && Project.TargetPlatforms.Length > 0) { // Restrict target platforms used to those specified in project file List <string> FilteredPlatforms = new List <string>(); // Always include the editor platform for cooking string EditorCookPlatform = Platform.GetPlatform(HostPlatform).GetEditorCookPlatform(); if (TargetPlatforms.Contains(EditorCookPlatform)) { FilteredPlatforms.Add(EditorCookPlatform); } foreach (string TargetPlatform in Project.TargetPlatforms) { if (TargetPlatforms.Contains(TargetPlatform)) { FilteredPlatforms.Add(TargetPlatform); } } if (FilteredPlatforms.Count == 0) { LogInformation("Did not find any project specific platforms for FeaturePack {0} out of supplied TargetPlatforms {1}, skipping it!", GameName, ProjectSpecificPlatforms); continue; } ProjectSpecificPlatforms = CommandUtils.CombineCommandletParams(FilteredPlatforms.Distinct().ToArray()); } CommandUtils.LogInformation("Generating DDC data for {0} on {1}", GameName, ProjectSpecificPlatforms); CommandUtils.DDCCommandlet(FileRef, EditorExe, null, ProjectSpecificPlatforms, String.Format("-fill -DDC={0} -ProjectOnly", BackendName)); string ProjectPakFile = CommandUtils.CombinePaths(Path.GetDirectoryName(OutputPakFile), String.Format("Compressed-{0}.ddp", GameName)); CommandUtils.DeleteFile(ProjectPakFile); CommandUtils.RenameFile(OutputPakFile, ProjectPakFile); string ProjectCsvFile = Path.ChangeExtension(ProjectPakFile, ".csv"); CommandUtils.DeleteFile(ProjectCsvFile); CommandUtils.RenameFile(OutputCsvFile, ProjectCsvFile); ProjectPakFiles.Add(Path.GetFileName(ProjectPakFile)); } // Generate DDC for the editor, and merge all the other PAK files in CommandUtils.LogInformation("Generating DDC data for engine content on {0}", TargetPlatforms); CommandUtils.DDCCommandlet(null, EditorExe, null, TargetPlatforms, String.Format("-fill -DDC={0} -MergePaks={1}{2}", BackendName, CommandUtils.MakePathSafeToUseWithCommandLine(String.Join("+", ProjectPakFiles)), bSkipEngine? " -projectonly" : "")); string SavedPakFile = CommandUtils.CombinePaths(SavedDir, RelativePakPath); CommandUtils.CopyFile(OutputPakFile, SavedPakFile); }
public static void Build(BuildCommand Command, ProjectParams Params, int WorkingCL = -1, ProjectBuildTargets TargetMask = ProjectBuildTargets.All) { Params.ValidateAndLog(); if (!Params.Build) { return; } if (CommandUtils.IsEngineInstalled() && !Params.IsCodeBasedProject) { return; } LogInformation("********** BUILD COMMAND STARTED **********"); var UE4Build = new UE4Build(Command); var Agenda = new UE4Build.BuildAgenda(); var CrashReportPlatforms = new HashSet <UnrealTargetPlatform>(); // Setup editor targets if (Params.HasEditorTargets && (!Params.SkipBuildEditor) && (TargetMask & ProjectBuildTargets.Editor) == ProjectBuildTargets.Editor) { // @todo Mac: proper platform detection UnrealTargetPlatform EditorPlatform = HostPlatform.Current.HostEditorPlatform; const UnrealTargetConfiguration EditorConfiguration = UnrealTargetConfiguration.Development; Agenda.AddTargets(Params.EditorTargets.ToArray(), EditorPlatform, EditorConfiguration, Params.CodeBasedUprojectPath); if (!CommandUtils.IsEngineInstalled()) { CrashReportPlatforms.Add(EditorPlatform); if (Params.EditorTargets.Contains("UnrealHeaderTool") == false) { Agenda.AddTargets(new string[] { "UnrealHeaderTool" }, EditorPlatform, EditorConfiguration); } if (Params.EditorTargets.Contains("ShaderCompileWorker") == false) { Agenda.AddTargets(new string[] { "ShaderCompileWorker" }, EditorPlatform, EditorConfiguration); } if (Params.FileServer && Params.EditorTargets.Contains("UnrealFileServer") == false) { Agenda.AddTargets(new string[] { "UnrealFileServer" }, EditorPlatform, EditorConfiguration); } } } // allow all involved platforms to hook into the agenda HashSet <UnrealTargetPlatform> UniquePlatforms = new HashSet <UnrealTargetPlatform>(); UniquePlatforms.UnionWith(Params.ClientTargetPlatforms.Select(x => x.Type)); UniquePlatforms.UnionWith(Params.ServerTargetPlatforms.Select(x => x.Type)); foreach (UnrealTargetPlatform TargetPlatform in UniquePlatforms) { Platform.GetPlatform(TargetPlatform).PreBuildAgenda(UE4Build, Agenda); } // Build any tools we need to stage if ((TargetMask & ProjectBuildTargets.UnrealPak) == ProjectBuildTargets.UnrealPak && !CommandUtils.IsEngineInstalled()) { if (Params.EditorTargets.Contains("UnrealPak") == false) { Agenda.AddTargets(new string[] { "UnrealPak" }, HostPlatform.Current.HostEditorPlatform, UnrealTargetConfiguration.Development, Params.CodeBasedUprojectPath); } } // Additional compile arguments string AdditionalArgs = ""; if (string.IsNullOrEmpty(Params.UbtArgs) == false) { AdditionalArgs += " " + Params.UbtArgs; } if (Params.MapFile) { AdditionalArgs += " -mapfile"; } if (Params.Deploy || Params.Package) { AdditionalArgs += " -skipdeploy"; // skip deploy step in UBT if we going to do it later anyway } if (Params.Distribution) { AdditionalArgs += " -distribution"; } // Config overrides (-ini) foreach (string ConfigOverrideParam in Params.ConfigOverrideParams) { AdditionalArgs += " -"; AdditionalArgs += ConfigOverrideParam; } // Setup cooked targets if (Params.HasClientCookedTargets && (!Params.SkipBuildClient) && (TargetMask & ProjectBuildTargets.ClientCooked) == ProjectBuildTargets.ClientCooked) { List <UnrealTargetPlatform> UniquePlatformTypes = Params.ClientTargetPlatforms.ConvertAll(x => x.Type).Distinct().ToList(); foreach (var BuildConfig in Params.ClientConfigsToBuild) { foreach (var ClientPlatformType in UniquePlatformTypes) { CrashReportPlatforms.Add(ClientPlatformType); Agenda.AddTargets(Params.ClientCookedTargets.ToArray(), ClientPlatformType, BuildConfig, Params.CodeBasedUprojectPath, InAddArgs: " -remoteini=\"" + Params.RawProjectPath.Directory.FullName + "\"" + AdditionalArgs); } } } if (Params.HasServerCookedTargets && (TargetMask & ProjectBuildTargets.ServerCooked) == ProjectBuildTargets.ServerCooked) { List <UnrealTargetPlatform> UniquePlatformTypes = Params.ServerTargetPlatforms.ConvertAll(x => x.Type).Distinct().ToList(); foreach (var BuildConfig in Params.ServerConfigsToBuild) { foreach (var ServerPlatformType in UniquePlatformTypes) { CrashReportPlatforms.Add(ServerPlatformType); Agenda.AddTargets(Params.ServerCookedTargets.ToArray(), ServerPlatformType, BuildConfig, Params.CodeBasedUprojectPath, InAddArgs: " -remoteini=\"" + Params.RawProjectPath.Directory.FullName + "\"" + AdditionalArgs); } } } if (!Params.NoBootstrapExe && !CommandUtils.IsEngineInstalled() && (TargetMask & ProjectBuildTargets.Bootstrap) == ProjectBuildTargets.Bootstrap) { UnrealBuildTool.UnrealTargetPlatform[] BootstrapPackagedGamePlatforms = { UnrealBuildTool.UnrealTargetPlatform.Win32, UnrealBuildTool.UnrealTargetPlatform.Win64 }; foreach (UnrealBuildTool.UnrealTargetPlatform BootstrapPackagedGamePlatformType in BootstrapPackagedGamePlatforms) { if (Params.ClientTargetPlatforms.Contains(new TargetPlatformDescriptor(BootstrapPackagedGamePlatformType))) { Agenda.AddTarget("BootstrapPackagedGame", BootstrapPackagedGamePlatformType, UnrealBuildTool.UnrealTargetConfiguration.Shipping); } } } if (Params.CrashReporter && !CommandUtils.IsEngineInstalled() && (TargetMask & ProjectBuildTargets.CrashReporter) == ProjectBuildTargets.CrashReporter) { foreach (var CrashReportPlatform in CrashReportPlatforms) { if (PlatformSupportsCrashReporter(CrashReportPlatform)) { Agenda.AddTarget("CrashReportClient", CrashReportPlatform, UnrealTargetConfiguration.Shipping, InAddArgs: " -remoteini=\"" + Params.RawProjectPath.Directory.FullName + "\""); } } } if (Params.HasProgramTargets && (TargetMask & ProjectBuildTargets.Programs) == ProjectBuildTargets.Programs) { List <UnrealTargetPlatform> UniquePlatformTypes = Params.ClientTargetPlatforms.ConvertAll(x => x.Type).Distinct().ToList(); foreach (var BuildConfig in Params.ClientConfigsToBuild) { foreach (var ClientPlatformType in UniquePlatformTypes) { Agenda.AddTargets(Params.ProgramTargets.ToArray(), ClientPlatformType, BuildConfig, Params.CodeBasedUprojectPath); } } } UE4Build.Build(Agenda, InDeleteBuildProducts: Params.Clean, InUpdateVersionFiles: WorkingCL > 0); if (WorkingCL > 0) // only move UAT files if we intend to check in some build products { UE4Build.AddUATFilesToBuildProducts(); } UE4Build.CheckBuildProducts(UE4Build.BuildProductFiles); if (WorkingCL > 0) { // Sign everything we built CodeSign.SignMultipleIfEXEOrDLL(Command, UE4Build.BuildProductFiles); // Open files for add or edit UE4Build.AddBuildProductsToChangelist(WorkingCL, UE4Build.BuildProductFiles); } LogInformation("********** BUILD COMMAND COMPLETED **********"); }
public BlueprintDocumentationNode(UnrealTargetPlatform InHostPlatform) : base(InHostPlatform) { AddDependency(GUBP.RootEditorNode.StaticGetFullName(InHostPlatform)); }
public TargetPlatformData(UnrealTargetPlatform InPlatform, string InArchitecture) { Platform = InPlatform; Architecture = InArchitecture; }