/// <summary> /// Creates a new process and adds it to the tracking list. /// </summary> /// <returns>New Process objects</returns> public static ProcessResult CreateProcess(string AppName, bool bAllowSpew, string LogName, Dictionary<string, string> Env = null, UnrealBuildTool.LogEventType SpewVerbosity = UnrealBuildTool.LogEventType.Console) { var NewProcess = HostPlatform.Current.CreateProcess(LogName); if (Env != null) { foreach (var EnvPair in Env) { if (NewProcess.StartInfo.EnvironmentVariables.ContainsKey(EnvPair.Key)) { NewProcess.StartInfo.EnvironmentVariables.Remove(EnvPair.Key); } if (!String.IsNullOrEmpty(EnvPair.Value)) { NewProcess.StartInfo.EnvironmentVariables.Add(EnvPair.Key, EnvPair.Value); } } } var Result = new ProcessResult(AppName, NewProcess, bAllowSpew, LogName, SpewVerbosity: SpewVerbosity); AddProcess(Result); return Result; }
void CleanWithUBT(string ProjectName, string TargetName, UnrealBuildTool.UnrealTargetPlatform Platform, string Config, string UprojectPath, bool ForceMonolithic = false, bool ForceNonUnity = false, bool ForceDebugInfo = false, string InAddArgs = "", bool ForceUnity = false, Dictionary<string, string> EnvVars = null) { string AddArgs = ""; if (string.IsNullOrEmpty(UprojectPath) == false) { AddArgs += " " + CommandUtils.MakePathSafeToUseWithCommandLine(UprojectPath); } AddArgs += " " + InAddArgs; if (ForceMonolithic) { AddArgs += " -monolithic"; } if (ForceNonUnity) { AddArgs += " -disableunity"; } if (ForceUnity) { AddArgs += " -forceunity"; } if (ForceDebugInfo) { AddArgs += " -forcedebuginfo"; } if (!TargetName.Equals("UnrealHeaderTool", StringComparison.InvariantCultureIgnoreCase)) { AddArgs += " -nobuilduht"; } PrepareUBT(); RunUBT(CmdEnv, UBTExecutable: UBTExecutable, Project: ProjectName, Target: TargetName, Platform: Platform.ToString(), Config: Config, AdditionalArgs: "-clean" + AddArgs, EnvVars: EnvVars); }
void BuildWithUBT(string ProjectName, string TargetName, UnrealBuildTool.UnrealTargetPlatform TargetPlatform, string Config, string UprojectPath, bool ForceMonolithic = false, bool ForceNonUnity = false, bool ForceDebugInfo = false, bool ForceFlushMac = false, bool DisableXGE = false, string InAddArgs = "", bool ForceUnity = false, Dictionary<string, string> EnvVars = null) { string AddArgs = ""; if (string.IsNullOrEmpty(UprojectPath) == false) { AddArgs += " " + CommandUtils.MakePathSafeToUseWithCommandLine(UprojectPath); } AddArgs += " " + InAddArgs; if (ForceMonolithic) { AddArgs += " -monolithic"; } if (ForceNonUnity) { AddArgs += " -disableunity"; } if (ForceUnity) { AddArgs += " -forceunity"; } if (ForceDebugInfo) { AddArgs += " -forcedebuginfo"; } if (ForceFlushMac) { AddArgs += " -flushmac"; } if (DisableXGE) { AddArgs += " -noxge"; } if(AddArgs.Contains("PostedRocket")) { if (UnrealBuildTool.BuildHostPlatform.Current.Platform == UnrealBuildTool.UnrealTargetPlatform.Win64) { BaseUBTDirectory = @"Rocket/TempInst/Windows"; } if (UnrealBuildTool.BuildHostPlatform.Current.Platform == UnrealBuildTool.UnrealTargetPlatform.Mac) { BaseUBTDirectory = @"Rocket/TempInst/Mac"; } } PrepareUBT(); // let the platform determine when to use the manifest bool UseManifest = Platform.Platforms[TargetPlatform].ShouldUseManifestForUBTBuilds(AddArgs); if (UseManifest) { string UBTManifest = GetUBTManifest(UprojectPath, AddArgs); DeleteFile(UBTManifest); RunUBT(CmdEnv, UBTExecutable: UBTExecutable, Project: ProjectName, Target: TargetName, Platform: TargetPlatform.ToString(), Config: Config, AdditionalArgs: "-generatemanifest" + AddArgs, EnvVars: EnvVars); PrepareManifest(UBTManifest); } RunUBT(CmdEnv, UBTExecutable: UBTExecutable, Project: ProjectName, Target: TargetName, Platform: TargetPlatform.ToString(), Config: Config, AdditionalArgs: AddArgs, EnvVars: EnvVars); // allow the platform to perform any actions after building a target (seems almost like this should be done in UBT) Platform.Platforms[TargetPlatform].PostBuildTarget(this, string.IsNullOrEmpty(ProjectName) ? TargetName : ProjectName, UprojectPath, Config); if (UseManifest) { string UBTManifest = GetUBTManifest(UprojectPath, AddArgs); AddBuildProductsFromManifest(UBTManifest); DeleteFile(UBTManifest); } }
public ProcessResult(string InAppName, Process InProc, bool bAllowSpew, string LogName, UnrealBuildTool.LogEventType SpewVerbosity = UnrealBuildTool.LogEventType.Console) { AppName = InAppName; ProcSyncObject = new object(); Proc = InProc; Source = LogName; AllowSpew = bAllowSpew; this.SpewVerbosity = SpewVerbosity; if (Proc != null) { Proc.EnableRaisingEvents = false; } }
private void LogOutput(UnrealBuildTool.LogEventType Verbosity, string Message) { UnrealBuildTool.Log.WriteLine(1, Source, Verbosity, Message); }
/// <summary> /// Adds multiple targets with the specified configuration. /// </summary> /// <param name="TargetNames">List of targets.</param> /// <param name="InPlatform">Platform</param> /// <param name="InConfiguration">Configuration</param> /// <param name="InUprojectPath">Path to optional uproject file</param> /// <param name="bForceMonolithic">Force monolithic build.</param> /// <param name="bForceNonUnity">Force non-unity</param> /// <param name="bForceDebugInfo">Force debug info even in development builds</param> public void AddTargets(string[] TargetNames, UnrealBuildTool.UnrealTargetPlatform InPlatform, UnrealBuildTool.UnrealTargetConfiguration InConfiguration, string InUprojectPath = null, bool bForceMonolithic = false, bool bForceNonUnity = false, bool bForceDebugInfo = false, string InAddArgs = "") { foreach (var Target in TargetNames) { Targets.Add(new BuildTarget() { TargetName = Target, Platform = InPlatform, Config = InConfiguration, UprojectPath = InUprojectPath, ForceMonolithic = bForceMonolithic, ForceNonUnity = bForceNonUnity, ForceDebugInfo = bForceDebugInfo, UBTArgs = InAddArgs, }); } }
/// <summary> /// Returns the default path of the editor executable to use for running commandlets. /// </summary> /// <param name="BuildRoot">Root directory for the build</param> /// <param name="HostPlatform">Platform to get the executable for</param> /// <returns>Path to the editor executable</returns> public static string GetEditorCommandletExe(string BuildRoot, UnrealBuildTool.UnrealTargetPlatform HostPlatform) { switch(HostPlatform) { case UnrealBuildTool.UnrealTargetPlatform.Mac: return CommandUtils.CombinePaths(BuildRoot, "Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor"); case UnrealBuildTool.UnrealTargetPlatform.Win64: return CommandUtils.CombinePaths(BuildRoot, "Engine/Binaries/Win64/UE4Editor-Cmd.exe"); case UnrealBuildTool.UnrealTargetPlatform.Linux: return CommandUtils.CombinePaths(BuildRoot, "Engine/Binaries/Linux/UE4Editor"); default: throw new AutomationException("EditorCommandlet is not supported for platform {0}", HostPlatform); } }
void BuildWithUBT(string ProjectName, string TargetName, UnrealBuildTool.UnrealTargetPlatform TargetPlatform, string Config, string UprojectPath, bool ForceMonolithic = false, bool ForceNonUnity = false, bool ForceDebugInfo = false, bool ForceFlushMac = false, bool DisableXGE = false, string InAddArgs = "", bool ForceUnity = false, Dictionary<string, string> EnvVars = null) { string AddArgs = ""; if (string.IsNullOrEmpty(UprojectPath) == false) { AddArgs += " " + CommandUtils.MakePathSafeToUseWithCommandLine(UprojectPath); } AddArgs += " " + InAddArgs; if (ForceMonolithic) { AddArgs += " -monolithic"; } if (ForceNonUnity) { AddArgs += " -disableunity"; } if (ForceUnity) { AddArgs += " -forceunity"; } if (ForceDebugInfo) { AddArgs += " -forcedebuginfo"; } if (ForceFlushMac) { AddArgs += " -flushmac"; } if (DisableXGE) { AddArgs += " -noxge"; } PrepareUBT(); // let the platform determine when to use the manifest bool UseManifest = Platform.Platforms[TargetPlatform].ShouldUseManifestForUBTBuilds(AddArgs); if (UseManifest) { string UBTManifest = GetUBTManifest(UprojectPath, AddArgs); DeleteFile(UBTManifest); using(TelemetryStopwatch PrepareManifestStopwatch = new TelemetryStopwatch("PrepareUBTManifest.{0}.{1}.{2}", TargetName, TargetPlatform.ToString(), Config)) { RunUBT(CmdEnv, UBTExecutable: UBTExecutable, Project: ProjectName, Target: TargetName, Platform: TargetPlatform.ToString(), Config: Config, AdditionalArgs: AddArgs + " -generatemanifest", EnvVars: EnvVars); } PrepareManifest(UBTManifest, false); } using(TelemetryStopwatch CompileStopwatch = new TelemetryStopwatch("Compile.{0}.{1}.{2}", TargetName, TargetPlatform.ToString(), Config)) { RunUBT(CmdEnv, UBTExecutable: UBTExecutable, Project: ProjectName, Target: TargetName, Platform: TargetPlatform.ToString(), Config: Config, AdditionalArgs: AddArgs, EnvVars: EnvVars); } // allow the platform to perform any actions after building a target (seems almost like this should be done in UBT) Platform.Platforms[TargetPlatform].PostBuildTarget(this, string.IsNullOrEmpty(ProjectName) ? TargetName : ProjectName, UprojectPath, Config); if (UseManifest) { string UBTManifest = GetUBTManifest(UprojectPath, AddArgs); AddBuildProductsFromManifest(UBTManifest); DeleteFile(UBTManifest); } }
public bool CanUseXGE(UnrealBuildTool.UnrealTargetPlatform Platform) { return UnrealBuildTool.UEBuildPlatform.GetBuildPlatform(Platform).CanUseXGE(); }
public ScriptPlugin(TargetInfo Target) { PublicIncludePaths.AddRange( new string[] { //"Programs/UnrealHeaderTool/Public", // ... add other public include paths required here ... } ); PrivateIncludePaths.AddRange( new string[] { // ... add other private include paths required here ... } ); PublicDependencyModuleNames.AddRange( new string[] { "Core", "CoreUObject", "Engine", "InputCore", "SlateCore", // ... add other public dependencies that you statically link with here ... } ); if (UEBuildConfiguration.bBuildEditor == true) { PublicDependencyModuleNames.AddRange( new string[] { "UnrealEd", } ); } DynamicallyLoadedModuleNames.AddRange( new string[] { // ... add any modules that your module loads dynamically here ... } ); if (!UnrealBuildTool.BuildingRocket()) { var LuaPath = Path.Combine("..", "Plugins", "ScriptPlugin", "Source", "Lua"); var LuaLibDirectory = Path.Combine(LuaPath, "Lib", Target.Platform.ToString(), "Release"); var LuaLibPath = Path.Combine(LuaLibDirectory, "Lua.lib"); if (File.Exists(LuaLibPath)) { Definitions.Add("WITH_LUA=1"); // Path to Lua include files var IncludePath = Path.GetFullPath(Path.Combine(LuaPath, "Include")); PrivateIncludePaths.Add(IncludePath); // Lib file PublicLibraryPaths.Add(LuaLibDirectory); PublicAdditionalLibraries.Add(LuaLibPath); Log.TraceVerbose("LUA Integration enabled: {0}", IncludePath); } else { Log.TraceVerbose("LUA Integration NOT enabled"); } } }
public static bool ShouldMakeSeparateApks() { // check to see if the project wants separate apks ConfigCacheIni Ini = new ConfigCacheIni(UnrealTargetPlatform.Android, "Engine", UnrealBuildTool.GetUProjectPath()); bool bSeparateApks = false; Ini.GetBool("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "bSplitIntoSeparateApks", out bSeparateApks); return(bSeparateApks); }
private void WriteEntitlementsFile(string OutputFilename) { // get the settings from the ini file // plist replacements ConfigCacheIni Ini = new ConfigCacheIni(UnrealTargetPlatform.IOS, "Engine", UnrealBuildTool.GetUProjectPath()); bool bSupported = false; Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bEnableCloudKitSupport", out bSupported); Directory.CreateDirectory(Path.GetDirectoryName(OutputFilename)); // we need to have something so Xcode will compile, so we just set the get-task-allow, since we know the value, // which is based on distribution or not (true means debuggable) StringBuilder Text = new StringBuilder(); Text.AppendLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); Text.AppendLine("<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">"); Text.AppendLine("<plist version=\"1.0\">"); Text.AppendLine("<dict>"); Text.AppendLine(string.Format("\t<key>get-task-allow</key><{0}/>", /*Config.bForDistribution ? "false" : */ "true")); if (bSupported) { Text.AppendLine("\t<key>com.apple.developer.icloud-container-identifiers</key>"); Text.AppendLine("\t<array>"); Text.AppendLine("\t\t<string>iCloud.$(CFBundleIdentifier)</string>"); Text.AppendLine("\t</array>"); Text.AppendLine("\t<key>com.apple.developer.icloud-services</key>"); Text.AppendLine("\t<array>"); Text.AppendLine("\t\t<string>CloudKit</string>"); Text.AppendLine("\t</array>"); } Text.AppendLine("</dict>"); Text.AppendLine("</plist>"); File.WriteAllText(OutputFilename, Text.ToString()); }
public override bool PrepTargetForDeployment(UEBuildTarget InTarget) { string GameName = InTarget.TargetName; string BuildPath = (GameName == "UE4Game" ? "../../Engine" : InTarget.ProjectDirectory) + "/Binaries/IOS"; string ProjectDirectory = InTarget.ProjectDirectory; bool bIsUE4Game = GameName.Contains("UE4Game"); string DecoratedGameName; if (InTarget.Configuration == UnrealTargetConfiguration.Development) { DecoratedGameName = GameName; } else { DecoratedGameName = String.Format("{0}-{1}-{2}", GameName, InTarget.Platform.ToString(), InTarget.Configuration.ToString()); } if (BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Mac && Environment.GetEnvironmentVariable("UBT_NO_POST_DEPLOY") != "true") { return(PrepForUATPackageOrDeploy(GameName, ProjectDirectory, BuildPath + "/" + DecoratedGameName, "../../Engine", false, "", false)); } else { // If it is requested, send the app bundle back to the platform executing these commands. if (BuildConfiguration.bCopyAppBundleBackToDevice) { Log.TraceInformation("Copying binaries back to this device..."); IOSToolChain Toolchain = UEToolChain.GetPlatformToolChain(CPPTargetPlatform.IOS) as IOSToolChain; try { string BinaryDir = Path.GetDirectoryName(InTarget.OutputPath) + "\\"; if (BinaryDir.EndsWith(InTarget.AppName + "\\Binaries\\IOS\\") && InTarget.TargetType != TargetRules.TargetType.Game) { BinaryDir = BinaryDir.Replace(InTarget.TargetType.ToString(), "Game"); } // Get the app bundle's name string AppFullName = InTarget.AppName; if (InTarget.Configuration != UnrealTargetConfiguration.Development) { AppFullName += "-" + InTarget.Platform.ToString(); AppFullName += "-" + InTarget.Configuration.ToString(); } foreach (string BinaryPath in Toolchain.BuiltBinaries) { if (!BinaryPath.Contains("Dummy")) { RPCUtilHelper.CopyFile(Toolchain.ConvertPath(BinaryPath), BinaryPath, false); } } Log.TraceInformation("Copied binaries successfully."); } catch (Exception) { Log.TraceInformation("Copying binaries back to this device failed."); } } GeneratePList(ProjectDirectory, bIsUE4Game, GameName, Path.GetFileNameWithoutExtension(UnrealBuildTool.GetUProjectFile()), "../../Engine", ""); } return(true); }
public static bool GeneratePList(string ProjectDirectory, bool bIsUE4Game, string GameName, string ProjectName, string InEngineDir, string AppDirectory) { // generate the Info.plist for future use string BuildDirectory = ProjectDirectory + "/Build/IOS"; bool bSkipDefaultPNGs = false; string IntermediateDirectory = (bIsUE4Game ? InEngineDir : ProjectDirectory) + "/Intermediate/IOS"; string PListFile = IntermediateDirectory + "/" + GameName + "-Info.plist"; VersionUtilities.BuildDirectory = BuildDirectory; VersionUtilities.GameName = GameName; // read the old file string OldPListData = File.Exists(PListFile) ? File.ReadAllText(PListFile) : ""; // determine if there is a launch.xib string LaunchXib = InEngineDir + "/Build/IOS/Resources/Interface/LaunchScreen.xib"; if (File.Exists(BuildDirectory + "/Resources/Interface/LaunchScreen.xib")) { LaunchXib = BuildDirectory + "/Resources/Interface/LaunchScreen.xib"; } // get the settings from the ini file // plist replacements ConfigCacheIni Ini = new ConfigCacheIni(UnrealTargetPlatform.IOS, "Engine", UnrealBuildTool.GetUProjectPath()); // orientations string SupportedOrientations = ""; bool bSupported = true; Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bSupportsPortraitOrientation", out bSupported); SupportedOrientations += bSupported ? "\t\t<string>UIInterfaceOrientationPortrait</string>\n" : ""; Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bSupportsUpsideDownOrientation", out bSupported); SupportedOrientations += bSupported ? "\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n" : ""; Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bSupportsLandscapeLeftOrientation", out bSupported); SupportedOrientations += bSupported ? "\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n" : ""; Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bSupportsLandscapeRightOrientation", out bSupported); SupportedOrientations += bSupported ? "\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n" : ""; // bundle display name string BundleDisplayName; Ini.GetString("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "BundleDisplayName", out BundleDisplayName); // bundle identifier string BundleIdentifier; Ini.GetString("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "BundleIdentifier", out BundleIdentifier); // bundle name string BundleName; Ini.GetString("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "BundleName", out BundleName); // short version string string BundleShortVersion; Ini.GetString("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "VersionInfo", out BundleShortVersion); // required capabilities string RequiredCaps = "\t\t<string>armv7</string>\n"; Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bSupportsOpenGLES2", out bSupported); RequiredCaps += bSupported ? "\t\t<string>opengles-2</string>\n" : ""; if (!bSupported) { Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bSupportsMetal", out bSupported); RequiredCaps += bSupported ? "\t\t<string>metal</string>\n" : ""; } // minimum iOS version string MinVersion; if (Ini.GetString("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "MinimumiOSVersion", out MinVersion)) { switch (MinVersion) { case "IOS_61": MinVersion = "6.1"; break; case "IOS_7": MinVersion = "7.0"; break; case "IOS_8": MinVersion = "8.0"; break; } } else { MinVersion = "6.1"; } // Get Facebook Support details bool bEnableFacebookSupport = true; Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bEnableFacebookSupport", out bEnableFacebookSupport); // Write the Facebook App ID if we need it. string FacebookAppID = ""; Ini.GetString("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "FacebookAppID", out FacebookAppID); bEnableFacebookSupport = bEnableFacebookSupport && !string.IsNullOrWhiteSpace(FacebookAppID); // extra plist data string ExtraData = ""; Ini.GetString("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "AdditionalPlistData", out ExtraData); // generate the plist file StringBuilder Text = new StringBuilder(); Text.AppendLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); Text.AppendLine("<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">"); Text.AppendLine("<plist version=\"1.0\">"); Text.AppendLine("<dict>"); Text.AppendLine("\t<key>CFBundleURLTypes</key>"); Text.AppendLine("\t<array>"); Text.AppendLine("\t\t<dict>"); Text.AppendLine("\t\t\t<key>CFBundleURLName</key>"); Text.AppendLine("\t\t\t<string>com.Epic.Unreal</string>"); Text.AppendLine("\t\t\t<key>CFBundleURLSchemes</key>"); Text.AppendLine("\t\t\t<array>"); Text.AppendLine(string.Format("\t\t\t\t<string>{0}</string>", bIsUE4Game ? "UE4Game" : GameName)); if (bEnableFacebookSupport) { // This is needed for facebook login to redirect back to the app after completion. Text.AppendLine(string.Format("\t\t\t\t<string>fb{0}</string>", FacebookAppID)); } Text.AppendLine("\t\t\t</array>"); Text.AppendLine("\t\t</dict>"); Text.AppendLine("\t</array>"); Text.AppendLine("\t<key>CFBundleDevelopmentRegion</key>"); Text.AppendLine("\t<string>English</string>"); Text.AppendLine("\t<key>CFBundleDisplayName</key>"); Text.AppendLine(string.Format("\t<string>{0}</string>", BundleDisplayName.Replace("[PROJECT_NAME]", ProjectName).Replace("_", ""))); Text.AppendLine("\t<key>CFBundleExecutable</key>"); Text.AppendLine(string.Format("\t<string>{0}</string>", bIsUE4Game ? "UE4Game" : GameName)); Text.AppendLine("\t<key>CFBundleIdentifier</key>"); Text.AppendLine(string.Format("\t<string>{0}</string>", BundleIdentifier.Replace("[PROJECT_NAME]", ProjectName).Replace("_", ""))); Text.AppendLine("\t<key>CFBundleInfoDictionaryVersion</key>"); Text.AppendLine("\t<string>6.0</string>"); Text.AppendLine("\t<key>CFBundleName</key>"); Text.AppendLine(string.Format("\t<string>{0}</string>", BundleName.Replace("[PROJECT_NAME]", ProjectName).Replace("_", ""))); Text.AppendLine("\t<key>CFBundlePackageType</key>"); Text.AppendLine("\t<string>APPL</string>"); Text.AppendLine("\t<key>CFBundleSignature</key>"); Text.AppendLine("\t<string>????</string>"); Text.AppendLine("\t<key>CFBundleVersion</key>"); Text.AppendLine(string.Format("\t<string>{0}</string>", VersionUtilities.UpdateBundleVersion(OldPListData))); Text.AppendLine("\t<key>CFBundleShortVersionString</key>"); Text.AppendLine(string.Format("\t<string>{0}</string>", BundleShortVersion)); Text.AppendLine("\t<key>LSRequiresIPhoneOS</key>"); Text.AppendLine("\t<true/>"); Text.AppendLine("\t<key>UIStatusBarHidden</key>"); Text.AppendLine("\t<true/>"); Text.AppendLine("\t<key>UISupportedInterfaceOrientations</key>"); Text.AppendLine("\t<array>"); foreach (string Line in SupportedOrientations.Split("\r\n".ToCharArray())) { if (!string.IsNullOrWhiteSpace(Line)) { Text.AppendLine(Line); } } Text.AppendLine("\t</array>"); Text.AppendLine("\t<key>UIRequiredDeviceCapabilities</key>"); Text.AppendLine("\t<array>"); foreach (string Line in RequiredCaps.Split("\r\n".ToCharArray())) { if (!string.IsNullOrWhiteSpace(Line)) { Text.AppendLine(Line); } } Text.AppendLine("\t</array>"); Text.AppendLine("\t<key>CFBundleIcons</key>"); Text.AppendLine("\t<dict>"); Text.AppendLine("\t\t<key>CFBundlePrimaryIcon</key>"); Text.AppendLine("\t\t<dict>"); Text.AppendLine("\t\t\t<key>CFBundleIconFiles</key>"); Text.AppendLine("\t\t\t<array>"); Text.AppendLine("\t\t\t\t<string>Icon29.png</string>"); Text.AppendLine("\t\t\t\t<string>[email protected]</string>"); Text.AppendLine("\t\t\t\t<string>Icon40.png</string>"); Text.AppendLine("\t\t\t\t<string>[email protected]</string>"); Text.AppendLine("\t\t\t\t<string>Icon57.png</string>"); Text.AppendLine("\t\t\t\t<string>[email protected]</string>"); Text.AppendLine("\t\t\t\t<string>[email protected]</string>"); Text.AppendLine("\t\t\t</array>"); Text.AppendLine("\t\t\t<key>UIPrerenderedIcon</key>"); Text.AppendLine("\t\t\t<true/>"); Text.AppendLine("\t\t</dict>"); Text.AppendLine("\t</dict>"); Text.AppendLine("\t<key>CFBundleIcons~ipad</key>"); Text.AppendLine("\t<dict>"); Text.AppendLine("\t\t<key>CFBundlePrimaryIcon</key>"); Text.AppendLine("\t\t<dict>"); Text.AppendLine("\t\t\t<key>CFBundleIconFiles</key>"); Text.AppendLine("\t\t\t<array>"); Text.AppendLine("\t\t\t\t<string>Icon29.png</string>"); Text.AppendLine("\t\t\t\t<string>[email protected]</string>"); Text.AppendLine("\t\t\t\t<string>Icon40.png</string>"); Text.AppendLine("\t\t\t\t<string>[email protected]</string>"); Text.AppendLine("\t\t\t\t<string>Icon50.png</string>"); Text.AppendLine("\t\t\t\t<string>[email protected]</string>"); Text.AppendLine("\t\t\t\t<string>Icon72.png</string>"); Text.AppendLine("\t\t\t\t<string>[email protected]</string>"); Text.AppendLine("\t\t\t\t<string>Icon76.png</string>"); Text.AppendLine("\t\t\t\t<string>[email protected]</string>"); Text.AppendLine("\t\t\t</array>"); Text.AppendLine("\t\t\t<key>UIPrerenderedIcon</key>"); Text.AppendLine("\t\t\t<true/>"); Text.AppendLine("\t\t</dict>"); Text.AppendLine("\t</dict>"); if (File.Exists(LaunchXib)) { // TODO: compile the xib via remote tool Text.AppendLine("\t<key>UILaunchStoryboardName</key>"); Text.AppendLine("\t<string>LaunchScreen</string>"); bSkipDefaultPNGs = true; } else { // this is a temp way to inject the iphone 6 images without needing to upgrade everyone's plist // eventually we want to generate this based on what the user has set in the project settings string[] IPhoneConfigs = { "Default-IPhone6", "Landscape", "{375, 667}", "Default-IPhone6", "Portrait", "{375, 667}", "Default-IPhone6Plus-Landscape", "Landscape", "{414, 736}", "Default-IPhone6Plus-Portrait", "Portrait", "{414, 736}", "Default", "Landscape", "{320, 480}", "Default", "Portrait", "{320, 480}", "Default-568h", "Landscape", "{320, 568}", "Default-568h", "Portrait", "{320, 568}", }; Text.AppendLine("\t<key>UILaunchImages~iphone</key>"); Text.AppendLine("\t<array>"); for (int ConfigIndex = 0; ConfigIndex < IPhoneConfigs.Length; ConfigIndex += 3) { Text.AppendLine("\t\t<dict>"); Text.AppendLine("\t\t\t<key>UILaunchImageMinimumOSVersion</key>"); Text.AppendLine("\t\t\t<string>8.0</string>"); Text.AppendLine("\t\t\t<key>UILaunchImageName</key>"); Text.AppendLine(string.Format("\t\t\t<string>{0}</string>", IPhoneConfigs[ConfigIndex + 0])); Text.AppendLine("\t\t\t<key>UILaunchImageOrientation</key>"); Text.AppendLine(string.Format("\t\t\t<string>{0}</string>", IPhoneConfigs[ConfigIndex + 1])); Text.AppendLine("\t\t\t<key>UILaunchImageSize</key>"); Text.AppendLine(string.Format("\t\t\t<string>{0}</string>", IPhoneConfigs[ConfigIndex + 2])); Text.AppendLine("\t\t</dict>"); } // close it out Text.AppendLine("\t</array>"); } Text.AppendLine("\t<key>UILaunchImages~ipad</key>"); Text.AppendLine("\t<array>"); Text.AppendLine("\t\t<dict>"); Text.AppendLine("\t\t\t<key>UILaunchImageMinimumOSVersion</key>"); Text.AppendLine("\t\t\t<string>7.0</string>"); Text.AppendLine("\t\t\t<key>UILaunchImageName</key>"); Text.AppendLine("\t\t\t<string>Default-Landscape</string>"); Text.AppendLine("\t\t\t<key>UILaunchImageOrientation</key>"); Text.AppendLine("\t\t\t<string>Landscape</string>"); Text.AppendLine("\t\t\t<key>UILaunchImageSize</key>"); Text.AppendLine("\t\t\t<string>{768, 1024}</string>"); Text.AppendLine("\t\t</dict>"); Text.AppendLine("\t\t<dict>"); Text.AppendLine("\t\t\t<key>UILaunchImageMinimumOSVersion</key>"); Text.AppendLine("\t\t\t<string>7.0</string>"); Text.AppendLine("\t\t\t<key>UILaunchImageName</key>"); Text.AppendLine("\t\t\t<string>Default-Portrait</string>"); Text.AppendLine("\t\t\t<key>UILaunchImageOrientation</key>"); Text.AppendLine("\t\t\t<string>Portrait</string>"); Text.AppendLine("\t\t\t<key>UILaunchImageSize</key>"); Text.AppendLine("\t\t\t<string>{768, 1024}</string>"); Text.AppendLine("\t\t</dict>"); Text.AppendLine("\t</array>"); Text.AppendLine("\t<key>CFBundleSupportedPlatforms</key>"); Text.AppendLine("\t<array>"); Text.AppendLine("\t\t<string>iPhoneOS</string>"); Text.AppendLine("\t</array>"); Text.AppendLine("\t<key>MinimumOSVersion</key>"); Text.AppendLine(string.Format("\t<string>{0}</string>", MinVersion)); if (bEnableFacebookSupport) { Text.AppendLine("\t<key>FacebookAppID</key>"); Text.AppendLine(string.Format("\t<string>{0}</string>", FacebookAppID)); } if (!string.IsNullOrEmpty(ExtraData)) { ExtraData = ExtraData.Replace("\\n", "\n"); foreach (string Line in ExtraData.Split("\r\n".ToCharArray())) { if (!string.IsNullOrWhiteSpace(Line)) { Text.AppendLine("\t" + Line); } } } Text.AppendLine("</dict>"); Text.AppendLine("</plist>"); // write the file out if (!Directory.Exists(IntermediateDirectory)) { Directory.CreateDirectory(IntermediateDirectory); } File.WriteAllText(PListFile, Text.ToString()); if (BuildHostPlatform.Current.Platform == UnrealTargetPlatform.Mac) { if (!Directory.Exists(AppDirectory)) { Directory.CreateDirectory(AppDirectory); } File.WriteAllText(AppDirectory + "/Info.plist", Text.ToString()); } return(bSkipDefaultPNGs); }
void XGEDeleteBuildProducts(UnrealBuildTool.BuildManifest Manifest) { foreach (string Item in Manifest.BuildProducts) { DeleteFile(Item); } }
/// <summary> /// Returns the default path of the editor executable to use for running commandlets. /// </summary> /// <param name="BuildRoot">Root directory for the build</param> /// <param name="HostPlatform">Platform to get the executable for</param> /// <returns>Path to the editor executable</returns> public static string GetEditorCommandletExe(string BuildRoot, UnrealBuildTool.UnrealTargetPlatform HostPlatform) { switch(HostPlatform) { case UnrealBuildTool.UnrealTargetPlatform.Mac: return CommandUtils.CombinePaths(BuildRoot, "Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor"); case UnrealBuildTool.UnrealTargetPlatform.Win64: return CommandUtils.CombinePaths(BuildRoot, "Engine/Binaries/Win64/UE4Editor-Cmd.exe"); default: throw new NotImplementedException(); } }
XGEItem XGEPrepareBuildWithUBT(string ProjectName, string TargetName, UnrealBuildTool.UnrealTargetPlatform Platform, string Config, string UprojectPath, bool ForceMonolithic = false, bool ForceNonUnity = false, bool ForceDebugInfo = false, string InAddArgs = "", bool ForceUnity = false, Dictionary<string, string> EnvVars = null) { string AddArgs = ""; if (string.IsNullOrEmpty(UprojectPath) == false) { AddArgs += " " + CommandUtils.MakePathSafeToUseWithCommandLine(UprojectPath); } AddArgs += " " + InAddArgs; if (ForceMonolithic) { AddArgs += " -monolithic"; } if (ForceNonUnity) { AddArgs += " -disableunity"; } if (ForceUnity) { AddArgs += " -forceunity"; } if (ForceDebugInfo) { AddArgs += " -forcedebuginfo"; } if(AddArgs.Contains("PostedRocket")) { if (UnrealBuildTool.BuildHostPlatform.Current.Platform == UnrealBuildTool.UnrealTargetPlatform.Win64) { BaseUBTDirectory = @"Rocket/TempInst/Windows"; } if (UnrealBuildTool.BuildHostPlatform.Current.Platform == UnrealBuildTool.UnrealTargetPlatform.Mac) { BaseUBTDirectory = @"Rocket/TempInst/Mac"; } } PrepareUBT(); string UBTManifest = GetUBTManifest(UprojectPath, AddArgs); DeleteFile(UBTManifest); XGEItem Result = new XGEItem(); ClearExportedXGEXML(); RunUBT(CmdEnv, UBTExecutable: UBTExecutable, Project: ProjectName, Target: TargetName, Platform: Platform.ToString(), Config: Config, AdditionalArgs: "-generatemanifest -nobuilduht -xgeexport" + AddArgs, EnvVars: EnvVars); PrepareManifest(UBTManifest); Result.Platform = Platform; Result.Config = Config; Result.ProjectName = string.IsNullOrEmpty(ProjectName) ? TargetName : ProjectName; // use the target as the project if no project is set Result.UProjectPath = UprojectPath; Result.Manifest = ReadManifest(UBTManifest); Result.OutputCaption = String.Format("{0}-{1}-{2}", Path.GetFileNameWithoutExtension(Result.ProjectName), Platform.ToString(), Config.ToString()); DeleteFile(UBTManifest); Result.CommandLine = UBTExecutable + " " + UBTCommandline(Project: ProjectName, Target: TargetName, Platform: Platform.ToString(), Config: Config, AdditionalArgs: "-noxge -nobuilduht" + AddArgs); Result.XgeXmlFiles = new List<string>(); foreach (var XGEFile in FindXGEFiles()) { if (!FileExists_NoExceptions(XGEFile)) { throw new AutomationException("BUILD FAILED: Couldn't find file: {0}", XGEFile); } int FileNum = 0; string OutFile; while (true) { OutFile = CombinePaths(CmdEnv.LogFolder, String.Format("UBTExport.{0}.xge.xml", FileNum)); FileInfo ItemInfo = new FileInfo(OutFile); if (!ItemInfo.Exists) { break; } FileNum++; } CopyFile(XGEFile, OutFile); Result.XgeXmlFiles.Add(OutFile); } ClearExportedXGEXML(); return Result; }
/// <summary> /// Adds multiple targets with the specified configuration. /// </summary> /// <param name="TargetNames">List of targets.</param> /// <param name="InPlatform">Platform</param> /// <param name="InConfiguration">Configuration</param> /// <param name="InUprojectPath">Path to optional uproject file</param> /// <param name="bForceMonolithic">Force monolithic build.</param> /// <param name="bForceNonUnity">Force non-unity</param> /// <param name="bForceDebugInfo">Force debug info even in development builds</param> public void AddTargets(string[] TargetNames, UnrealBuildTool.UnrealTargetPlatform InPlatform, UnrealBuildTool.UnrealTargetConfiguration InConfiguration, string InUprojectPath = null, bool bForceMonolithic = false, bool bForceNonUnity = false, bool bForceDebugInfo = false, string InAddArgs = "") { // Is this platform a compilable target? if (!Platform.Platforms[InPlatform].CanBeCompiled()) { return; } foreach (var Target in TargetNames) { Targets.Add(new BuildTarget() { TargetName = Target, Platform = InPlatform, Config = InConfiguration, UprojectPath = InUprojectPath, ForceMonolithic = bForceMonolithic, ForceNonUnity = bForceNonUnity, ForceDebugInfo = bForceDebugInfo, UBTArgs = InAddArgs, }); } }
public bool CanUseXGE(UnrealBuildTool.UnrealTargetPlatform Platform) { if (!UnrealBuildTool.UEBuildPlatform.BuildPlatformDictionary.ContainsKey(Platform)) { return false; } return UnrealBuildTool.UEBuildPlatform.GetBuildPlatform(Platform).CanUseXGE(); }
public Fuse(TargetInfo Target) { PublicIncludePaths.AddRange( new string[] { // ... add public include paths required here ... } ); PrivateIncludePaths.AddRange( new string[] { "Developer/Fuse/Private", // ... add other private include paths required here ... } ); PublicDependencyModuleNames.AddRange( new string[] { "Core", "CoreUObject", "Engine", "OnlineSubsystem" // ... add other public dependencies that you statically link with here ... } ); PrivateDependencyModuleNames.AddRange( new string[] { // ... add private dependencies that you statically link with here ... } ); DynamicallyLoadedModuleNames.AddRange( new string[] { // ... add any modules that your module loads dynamically here ... } ); PrivateIncludePathModuleNames.AddRange( new string[] { "Settings" } ); if (Target.Platform == UnrealTargetPlatform.IOS) { // required frameworks PublicFrameworks.AddRange( new string[] { "Accelerate", "AdSupport", "AudioToolbox", "AVFoundation", "CoreGraphics", "CoreLocation", "CoreMedia", "CoreTelephony", "EventKit", "EventKitUI", "Foundation", "GameKit", "MediaPlayer", "MessageUI", "MobileCoreServices", "QuartzCore", "Social", "StoreKit", "SystemConfiguration", "Twitter", "UIKit" } ); // required libs PublicAdditionalLibraries.Add("sqlite3"); PublicAdditionalLibraries.Add("xml2"); PublicAdditionalLibraries.Add("z"); // include Fuse SDK var CodeDir = Path.Combine(ModulePath, "..", "..", "lib", "FuseSDKiOS", "Code"); PrivateIncludePaths.Add(CodeDir); PublicAdditionalLibraries.Add(Path.Combine(CodeDir, "libFuseSDK.a")); // collect settings ConfigCacheIni Ini = new ConfigCacheIni(UnrealTargetPlatform.IOS, "Engine", UnrealBuildTool.GetUProjectPath()); bool bIncludeAdColony = false; bool bIncludeAppLovin = false; bool bIncludeHyprMX = false; bool bIncludeAdMob = false; bool bIncludeChartboost = false; bool bIncludeFacebook = false; bool bIncludeiAd = false; bool bIncludeMillennial = false; string SettingsPath = "/Script/Fuse.FuseSettings"; Ini.GetBool(SettingsPath, "bIncludeAdColony", out bIncludeAdColony); Ini.GetBool(SettingsPath, "bIncludeAppLovin", out bIncludeAppLovin); Ini.GetBool(SettingsPath, "bIncludeHyprMX", out bIncludeHyprMX); Ini.GetBool(SettingsPath, "bIncludeAdMob", out bIncludeAdMob); Ini.GetBool(SettingsPath, "bIncludeChartboost", out bIncludeChartboost); Ini.GetBool(SettingsPath, "bIncludeFacebook", out bIncludeFacebook); Ini.GetBool(SettingsPath, "bIncludeiAd", out bIncludeiAd); Ini.GetBool(SettingsPath, "bIncludeMillennial", out bIncludeMillennial); // include optional adapters if (bIncludeAdColony) { PublicAdditionalLibraries.Add(Path.Combine(CodeDir, "libFuseAdapterAdcolony.a")); } if (bIncludeAppLovin) { PublicAdditionalLibraries.Add(Path.Combine(CodeDir, "libFuseAdapterAppLovin.a")); } if (bIncludeHyprMX) { PublicAdditionalLibraries.Add(Path.Combine(CodeDir, "libFuseAdapterHyprMX.a")); } var FuseExtrasDir = Path.Combine(ModulePath, "..", "..", "lib", "FuseSDKiOS", "Extras"); var ExtrasiOSDir = "../../lib/Extras/iOS"; if (bIncludeAdMob) { PublicAdditionalLibraries.Add(Path.Combine(FuseExtrasDir, "AdMob", "libFuseAdapterAdMob.a")); PublicAdditionalFrameworks.Add( new UEBuildFramework( "GoogleMobileAds", ExtrasiOSDir + "/AdMob/GoogleMobileAds.embeddedframework.zip" ) ); } if (bIncludeChartboost) { PublicAdditionalLibraries.Add(Path.Combine(FuseExtrasDir, "ChartBoost", "libFuseAdapterChartBoost.a")); PublicAdditionalFrameworks.Add( new UEBuildFramework( "Chartboost", ExtrasiOSDir + "/Chartboost/Chartboost.embeddedframework.zip" ) ); } if (bIncludeFacebook) { PublicAdditionalLibraries.Add(Path.Combine(FuseExtrasDir, "Facebook", "libFuseAdapterFacebook.a")); PublicAdditionalFrameworks.Add( new UEBuildFramework( "FBAudienceNetwork", ExtrasiOSDir + "/Facebook/FBAudienceNetwork.embeddedframework.zip" ) ); } if (bIncludeiAd) { PublicAdditionalLibraries.Add(Path.Combine(FuseExtrasDir, "iAd", "libFuseAdapteriAd.a")); } if (bIncludeMillennial) { PublicAdditionalLibraries.Add(Path.Combine(FuseExtrasDir, "Millennial", "libFuseAdapterMillennial.a")); PublicAdditionalFrameworks.Add( new UEBuildFramework( "MillennialMedia", ExtrasiOSDir + "/Millennial/MillennialMedia.embeddedframework.zip" ) ); PublicAdditionalLibraries.Add(Path.Combine(FuseExtrasDir, "AdMob", "libFuseAdapterAdMob.a")); PublicAdditionalFrameworks.Add( new UEBuildFramework( "SpeechKit", ExtrasiOSDir + "/Millennial/SpeechKit.embeddedframework.zip" ) ); } } }