public void SetupSteam() { // C++ Flags PublicDefinitions.Add("WARRIORB_WITH_STEAM=" + BoolToIntString(WARRIORB_WITH_STEAM)); PublicDefinitions.Add("WARRIORB_STEAM_APP_ID=" + IntToString(WARRIORB_STEAM_APP_ID)); PublicDefinitions.Add("WARRIORB_STEAM_DEMO_APP_ID=" + IntToString(WARRIORB_STEAM_DEMO_APP_ID)); PublicDefinitions.Add("WARRIORB_RELAUNCH_IN_STEAM=" + BoolToIntString(WARRIORB_RELAUNCH_IN_STEAM)); PublicDefinitions.Add("WARRIORB_STEAM_CHECK_IF_LIBRARY_CHECKSUM_MATCHES=" + BoolToIntString(WARRIORB_STEAM_CHECK_IF_LIBRARY_CHECKSUM_MATCHES)); PublicDefinitions.Add(String.Format("WARRIORB_STEAM_LIBRARY_WINDOWS_API64_SHA1_SUM=\"{0}\"", WARRIORB_STEAM_LIBRARY_WINDOWS_API64_SHA1_SUM)); ConfigHierarchy ConfigEngineHierarchy = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, new DirectoryReference(ProjectRootPath), Target.Platform); Dictionary <string, string> SteamReplacements = new Dictionary <string, string>(); // Steam if (WARRIORB_WITH_STEAM) { // Replace the steam id with our own defined one // Same for the Game Version // SteamDevAppId { int CurrentAppid; ConfigEngineHierarchy.GetInt32("OnlineSubsystemSteam", "SteamDevAppId", out CurrentAppid); string FormatString = "SteamDevAppId={0}"; SteamReplacements.Add(String.Format(FormatString, CurrentAppid), String.Format(FormatString, SteamAppid)); } // GameVersion { string CurrentGameVersion; ConfigEngineHierarchy.GetString("OnlineSubsystemSteam", "GameVersion", out CurrentGameVersion); string FormatString = "GameVersion={0}"; SteamReplacements.Add(String.Format(FormatString, CurrentGameVersion), String.Format(FormatString, WARRIORB_BUILD_VERSION)); } // Relaunch in Steam? // https://partner.steamgames.com/doc/api/steam_api#SteamAPI_RestartAppIfNecessary // NOTE: disabled at it is broken anyways // { // bool CurrentRelaunchInSteam; // ConfigEngineHierarchy.GetBool("OnlineSubsystemSteam", "bRelaunchInSteam", out CurrentRelaunchInSteam); // string FormatString = "bRelaunchInSteam={0}"; // SteamReplacements.Add(String.Format(FormatString, CurrentRelaunchInSteam), String.Format(FormatString, WARRIORB_RELAUNCH_IN_STEAM)); // } // Include plugins PrivateDependencyModuleNames.Add("NotYetSteam"); DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam"); } // bEnabled // { // bool CurrentEnabled; // ConfigEngineHierarchy.GetBool("OnlineSubsystemSteam", "bEnabled", out CurrentEnabled); // string FormatString = "bEnabled={0}"; // SteamReplacements.Add(String.Format(FormatString, CurrentEnabled), String.Format(FormatString, WARRIORB_WITH_STEAM)); // } PatchFile(DefaultEngineConfigPath, SteamReplacements); }
public override void PlatformSetupParams(ref ProjectParams ProjParams) { base.PlatformSetupParams(ref ProjParams); string ConfigTargetArchicture = ""; ConfigHierarchy PlatformEngineConfig = null; if (ProjParams.EngineConfigs.TryGetValue(PlatformType, out PlatformEngineConfig)) { PlatformEngineConfig.GetString("/Script/MacTargetPlatform.MacTargetSettings", "TargetArchitecture", out ConfigTargetArchicture); if (ConfigTargetArchicture.ToLower().Contains("intel")) { ProjectTargetArchitectures = new[] { MacExports.IntelArchitecture }; } else if (ConfigTargetArchicture.ToLower().Contains("apple")) { ProjectTargetArchitectures = new[] { MacExports.AppleArchitecture }; } else if (ConfigTargetArchicture.ToLower().Contains("universal")) { ProjectTargetArchitectures = new[] { MacExports.IntelArchitecture, MacExports.AppleArchitecture }; } } }
// Load SkookumScript.ini and return any ScriptSupportedModules specified public static List <string> GetSkookumScriptModuleNames(string PluginOrProjectRootDirectory, bool AddSkookumScriptRuntime = true) { List <string> moduleList = null; // Load SkookumScript.ini and get ScriptSupportedModules string iniFilePath = Path.Combine(PluginOrProjectRootDirectory, "Config/SkookumScript.ini"); if (File.Exists(iniFilePath)) { ConfigFile iniFile = new ConfigFile(new FileReference(iniFilePath), ConfigLineAction.Add); var skookumConfig = new ConfigHierarchy(new ConfigFile[] { iniFile }); skookumConfig.GetArray("CommonSettings", "ScriptSupportedModules", out moduleList); } if (moduleList == null) { moduleList = new List <string>(); } // Add additional modules needed for SkookumScript to function moduleList.Add("AgogCore"); moduleList.Add("SkookumScript"); if (AddSkookumScriptRuntime) { moduleList.Add("SkookumScriptRuntime"); } return(moduleList); }
private ProjectImportExportInfo GenerateProjectImportExportInfo(string RootWorkingDirectory, string LocalizationConfigFile) { ConfigFile File = new ConfigFile(new FileReference(LocalizationConfigFile), ConfigLineAction.Add); var LocalizationConfig = new ConfigHierarchy(new ConfigFile[] { File }); string DestinationPath; if (!LocalizationConfig.GetString("CommonSettings", "DestinationPath", out DestinationPath)) { throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'DestinationPath', File: '{0}'", LocalizationConfigFile); } string ManifestName; if (!LocalizationConfig.GetString("CommonSettings", "ManifestName", out ManifestName)) { throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'ManifestName', File: '{0}'", LocalizationConfigFile); } string ArchiveName; if (!LocalizationConfig.GetString("CommonSettings", "ArchiveName", out ArchiveName)) { throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'ArchiveName', File: '{0}'", LocalizationConfigFile); } string PortableObjectName; if (!LocalizationConfig.GetString("CommonSettings", "PortableObjectName", out PortableObjectName)) { throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'PortableObjectName', File: '{0}'", LocalizationConfigFile); } string NativeCulture; if (!LocalizationConfig.GetString("CommonSettings", "NativeCulture", out NativeCulture)) { throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'NativeCulture', File: '{0}'", LocalizationConfigFile); } List <string> CulturesToGenerate; if (!LocalizationConfig.GetArray("CommonSettings", "CulturesToGenerate", out CulturesToGenerate)) { throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'CulturesToGenerate', File: '{0}'", LocalizationConfigFile); } bool bUseCultureDirectory; if (!LocalizationConfig.GetBool("CommonSettings", "bUseCultureDirectory", out bUseCultureDirectory)) { // bUseCultureDirectory is optional, default is true bUseCultureDirectory = true; } var ProjectImportExportInfo = new ProjectImportExportInfo(DestinationPath, ManifestName, ArchiveName, PortableObjectName, NativeCulture, CulturesToGenerate, bUseCultureDirectory); ProjectImportExportInfo.CalculateSplitPlatformNames(RootWorkingDirectory); return(ProjectImportExportInfo); }
public AndroidDeviceProfileSelector(ReadOnlyTargetRules Target) : base(Target) { ShortName = "AndroidDPS"; // get a value from .ini (ConfigFile attribute doesn't work in Build.cs files it seems) ConfigHierarchy Ini = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, Target.ProjectFile != null ? Target.ProjectFile.Directory : null, Target.Platform); string SecretGuid; Ini.GetString("AndroidDPSBuildSettings", "SecretGuid", out SecretGuid); if (!string.IsNullOrEmpty(SecretGuid)) { PrivateDefinitions.Add("HASH_PEPPER_SECRET_GUID=" + SecretGuid); } PublicDependencyModuleNames.AddRange( new string[] { "Core", "CoreUObject", } ); PrivateDependencyModuleNames.AddRange( new string[] { "Core", "CoreUObject", "Engine", } ); }
public CentralConfigManager() { InitializeComponent(); hierarchy = GetCentralConfig(); hierarchy.Levels.Add("BITS_JOB_SPEC"); PopulateDefault(); }
public OnlineSubsystemApple(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; if (Target.Platform == UnrealTargetPlatform.IOS || Target.Platform == UnrealTargetPlatform.TVOS) { ConfigHierarchy PlatformGameConfig = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromFile(Target.ProjectFile), UnrealTargetPlatform.IOS); PlatformGameConfig.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bEnableSignInWithAppleSupport", out bSignInWithAppleSupported); } else if (Target.Platform == UnrealTargetPlatform.Mac) { // TODO: Mark.Fitt enable Mac support } PrivateIncludePaths.Add("Private"); PublicDefinitions.Add("ONLINESUBSYSTEMAPPLE_PACKAGE=1"); PublicDefinitions.Add("ONLINESUBSYSTEMAPPLE_IDENTITY_ENABLE_SIWA=" + (bSignInWithAppleSupported ? "1" : "0")); PrivateDependencyModuleNames.AddRange( new string[] { "Core", "CoreUObject", "Engine", "OnlineSubsystem", }); if (Target.Platform == UnrealTargetPlatform.Mac || Target.Platform == UnrealTargetPlatform.IOS || Target.Platform == UnrealTargetPlatform.TVOS) { if (bSignInWithAppleSupported) { PublicWeakFrameworks.Add("AuthenticationServices"); } } }
public static bool GetGenerateFrameworkWrapperProject(DirectoryReference ProjectDirectory) { ConfigHierarchy Ini = GetIni(ProjectDirectory); bool bGenerateFrameworkWrapperProject; Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bGenerateFrameworkWrapperProject", out bGenerateFrameworkWrapperProject); return(bGenerateFrameworkWrapperProject); }
public static bool HasPlatformBundleSource(DirectoryReference ProjectDir, UnrealTargetPlatform Platform) { ConfigHierarchy BundleConfig = ConfigCache.ReadHierarchy(ConfigHierarchyType.InstallBundle, ProjectDir, Platform); return (BundleConfig.GetArray("InstallBundleManager.BundleSources", "DefaultBundleSources", out List <string> InstallBundleSources) && InstallBundleSources.Contains("Platform")); }
public static bool GetBuildAsFramework(DirectoryReference ProjectDirectory) { ConfigHierarchy Ini = GetIni(ProjectDirectory); bool bBuildAsFramework; Ini.GetBool("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bBuildAsFramework", out bBuildAsFramework); return(bBuildAsFramework); }
protected void DoBuildCookRun(ProjectParams Params) { const ProjectBuildTargets ClientTargets = ProjectBuildTargets.ClientCooked | ProjectBuildTargets.ServerCooked; bool bGenerateNativeScripts = Params.RunAssetNativization; int WorkingCL = -1; if (P4Enabled && GlobalCommandLine.Submit && AllowSubmit) { WorkingCL = P4.CreateChange(P4Env.Client, String.Format("{0} build from changelist {1}", Params.ShortProjectName, P4Env.Changelist)); } Project.Build(this, Params, WorkingCL, bGenerateNativeScripts ? (ProjectBuildTargets.All & ~ClientTargets) : ProjectBuildTargets.All); Project.Cook(Params); if (bGenerateNativeScripts) { // crash reporter is built along with client targets, so we need to // include that target flag here as well - note: that its not folded // into ClientTargets because the editor needs its own CrashReporter // as well (which would be built above) Project.Build(this, Params, WorkingCL, ClientTargets | ProjectBuildTargets.CrashReporter); } else { ConfigHierarchy GameIni = ConfigCache.ReadHierarchy(ConfigHierarchyType.Game, Params.RawProjectPath.Directory, HostPlatform.Current.HostEditorPlatform); if (GameIni != null) { List <string> NativizeBlueprintAssets = null; string BlueprintNativizationMethod = "Disabled"; bool bWarnIfPackagedWithoutNativizationFlag = true; GameIni.GetString("/Script/UnrealEd.ProjectPackagingSettings", "BlueprintNativizationMethod", out BlueprintNativizationMethod); GameIni.GetBool("/Script/UnrealEd.ProjectPackagingSettings", "bWarnIfPackagedWithoutNativizationFlag", out bWarnIfPackagedWithoutNativizationFlag); GameIni.GetArray("/Script/UnrealEd.ProjectPackagingSettings", "NativizeBlueprintAssets", out NativizeBlueprintAssets); if (bWarnIfPackagedWithoutNativizationFlag && BlueprintNativizationMethod != "Disabled") { // Warn if we're cooking without the -nativizeAssets flag, when the project settings specify a nativization method. // If the "exclusive" (whitelist) method is set, we only warn if at least one asset has been selected for conversion. if (BlueprintNativizationMethod != "Exclusive" || (NativizeBlueprintAssets != null && NativizeBlueprintAssets.Count > 0)) { LogWarning("Project is configured for Blueprint nativization, but the conversion flag (-nativizeAssets) was omitted from the command line. No nativized assets have been built as a result."); } } } } Project.CopyBuildToStagingDirectory(Params); Project.Package(Params, WorkingCL); Project.Archive(Params); Project.Deploy(Params); PrintRunTime(); Project.Run(Params); // Check everything in! if (WorkingCL != -1) { int SubmittedCL; P4.Submit(WorkingCL, out SubmittedCL, true, true); } }
public static string GetBundleName(DirectoryReference ProjectDirectory, FileReference ProjectFile) { ConfigHierarchy Ini = GetIni(ProjectDirectory); string BundleName; Ini.GetString("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "BundleName", out BundleName); BundleName = BundleName.Replace("[PROJECT_NAME]", ((ProjectFile != null) ? ProjectFile.GetFileNameWithoutAnyExtensions() : "UE4Game")).Replace("_", ""); return(BundleName); }
//public bool CopyFileToDevice(string PackageName, string SourcePath, string DestPath, bool IgnoreDependencies = false) //{ // This function existed for Android, but I don't think we necessarily need it for Lumin. No separate OBB-style data currently. // If needed in the future can base it off Gauntlet.TargetDeviceAndroid.cs' implementation. //} // This is the com.yourcompany.projectname that is shown for installs on device public string GetQualifiedProjectName(string ProjectName) { // ask the .ini system for what version to use ConfigHierarchy Ini = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromString(Path.Combine(Environment.CurrentDirectory, ProjectName).ToString()), UnrealTargetPlatform.Lumin); // check for project override of NDK API level string QualifiedPackageName; Ini.GetString("/Script/LuminRuntimeSettings.LuminRuntimeSettings", "PackageName", out QualifiedPackageName); QualifiedPackageName = QualifiedPackageName.Trim(); QualifiedPackageName = QualifiedPackageName.Replace("[PROJECT]", ProjectName); return QualifiedPackageName.ToLower(); }
public void UploadToS3(DeploymentContext SC) { ConfigHierarchy Ini = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromFile(SC.RawProjectPath), SC.StageTargetPlatform.PlatformType); bool Upload = false; string KeyId = ""; string AccessKey = ""; string BucketName = ""; string FolderName = ""; if (Ini.GetBool("/Script/HTML5PlatformEditor.HTML5TargetSettings", "UploadToS3", out Upload)) { if (!Upload) { return; } } else { return; } bool AmazonIdentity = Ini.GetString("/Script/HTML5PlatformEditor.HTML5TargetSettings", "S3KeyID", out KeyId) && Ini.GetString("/Script/HTML5PlatformEditor.HTML5TargetSettings", "S3SecretAccessKey", out AccessKey) && Ini.GetString("/Script/HTML5PlatformEditor.HTML5TargetSettings", "S3BucketName", out BucketName) && Ini.GetString("/Script/HTML5PlatformEditor.HTML5TargetSettings", "S3FolderName", out FolderName); if (!AmazonIdentity) { Log("Amazon S3 Incorrectly configured"); return; } if (FolderName == "") { FolderName = SC.ShortProjectName; } List <Task> UploadTasks = new List <Task>(); foreach (KeyValuePair <string, string> Entry in SC.ArchivedFiles) { FileInfo Info = new FileInfo(Entry.Key); UploadTasks.Add(Task.Factory.StartNew(() => UploadToS3Worker(Info, KeyId, AccessKey, BucketName, FolderName))); } Task.WaitAll(UploadTasks.ToArray()); string URL = "http://" + BucketName + ".s3.amazonaws.com/" + FolderName + "/" + SC.ShortProjectName + ".html"; Log("Your project's shareable link is: " + URL); Log("Upload Tasks finished."); }
/// <summary> /// Read a list of whitelisted or blacklisted config files names from a config file /// </summary> /// <param name="Config">The config hierarchy to read from</param> /// <param name="SectionName">The section name</param> /// <param name="KeyName">The key name to read from</param> /// <param name="ConfigFiles">Receives a list of config file paths</param> private static void ReadConfigFileList(ConfigHierarchy Config, string SectionName, string KeyName, HashSet <StagedFileReference> ConfigFiles) { List <string> ConfigFileNames; if (Config.GetArray(SectionName, KeyName, out ConfigFileNames)) { foreach (string ConfigFileName in ConfigFileNames) { ConfigFiles.Add(new StagedFileReference(ConfigFileName)); } } }
public static bool LoadBundleConfig(string BundleIniFile, ref Dictionary <string, BundleSettings> Bundles) { if (System.IO.File.Exists(BundleIniFile) == false) { CommandUtils.LogWarning("Unable to find bundle config ini file {0}", BundleIniFile); return(false); } FileReference BundleFileReference = new FileReference(BundleIniFile); ConfigHierarchy BundleConfig = new ConfigHierarchy(new ConfigFile[] { new ConfigFile(BundleFileReference) }); int PriorityCounter = 0; foreach (string SectionName in BundleConfig.SectionNames) { BundleSettings Bundle = new BundleSettings(); Bundle.Name = SectionName; Bundle.Priority = PriorityCounter; ++PriorityCounter; { string ExecFileName; BundleConfig.GetString(SectionName, "ExecFileName", out ExecFileName); Bundle.ExecFileName = ExecFileName; } { List <string> Tags; BundleConfig.GetArray(SectionName, "Tags", out Tags); Bundle.Tags = Tags; } { List <string> FileRegex; BundleConfig.GetArray(SectionName, "FileRegex", out FileRegex); Bundle.FileRegex = FileRegex; } { bool bContainsShaderLibrary; BundleConfig.GetBool(SectionName, "ContainsShaderLibrary", out bContainsShaderLibrary); Bundle.bContainsShaderLibrary = bContainsShaderLibrary; } if (Bundle.Tags == null) { Bundle.Tags = new List <string>(); } Bundles.Add(SectionName, Bundle); } return(true); }
private ProjectImportExportInfo GenerateProjectImportExportInfo(string LocalizationConfigFile) { var ProjectImportExportInfo = new ProjectImportExportInfo(); ConfigFile File = new ConfigFile(new FileReference(LocalizationConfigFile), ConfigLineAction.Add); var LocalizationConfig = new ConfigHierarchy(new ConfigFile[] { File }); if (!LocalizationConfig.GetString("CommonSettings", "DestinationPath", out ProjectImportExportInfo.DestinationPath)) { throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'DestinationPath', File: '{0}'", LocalizationConfigFile); } if (!LocalizationConfig.GetString("CommonSettings", "ManifestName", out ProjectImportExportInfo.ManifestName)) { throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'ManifestName', File: '{0}'", LocalizationConfigFile); } if (!LocalizationConfig.GetString("CommonSettings", "ArchiveName", out ProjectImportExportInfo.ArchiveName)) { throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'ArchiveName', File: '{0}'", LocalizationConfigFile); } if (!LocalizationConfig.GetString("CommonSettings", "PortableObjectName", out ProjectImportExportInfo.PortableObjectName)) { throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'PortableObjectName', File: '{0}'", LocalizationConfigFile); } if (!LocalizationConfig.GetString("CommonSettings", "NativeCulture", out ProjectImportExportInfo.NativeCulture)) { throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'NativeCulture', File: '{0}'", LocalizationConfigFile); } if (!LocalizationConfig.GetArray("CommonSettings", "CulturesToGenerate", out ProjectImportExportInfo.CulturesToGenerate)) { throw new AutomationException("Failed to find a required config key! Section: 'CommonSettings', Key: 'CulturesToGenerate', File: '{0}'", LocalizationConfigFile); } if (!LocalizationConfig.GetBool("CommonSettings", "bUseCultureDirectory", out ProjectImportExportInfo.bUseCultureDirectory)) { // bUseCultureDirectory is optional, default is true ProjectImportExportInfo.bUseCultureDirectory = true; } return(ProjectImportExportInfo); }
/** * Notify stakeholders of the commandlet results */ void SendCompletionMessage(bool bWasSuccessful, String MessageBody) { MailMessage Message = new System.Net.Mail.MailMessage(); Message.Priority = MailPriority.High; Message.From = new MailAddress("*****@*****.**"); string Branch = "Unknown"; if (P4Enabled) { Branch = P4Env.Branch; } foreach (String NextStakeHolder in StakeholdersEmailAddresses) { Message.To.Add(new MailAddress(NextStakeHolder)); } ConfigHierarchy Ini = ConfigCache.ReadHierarchy(ConfigHierarchyType.EditorPerProjectUserSettings, DirectoryReference.FromFile(ProjectFullPath), UnrealTargetPlatform.Win64); List <string> Emails; Ini.GetArray("RebuildlightingSettings", "EmailNotification", out Emails); foreach (var Email in Emails) { Message.CC.Add(new MailAddress(Email)); } Message.Subject = String.Format("Nightly lightmap rebuild {0} for {1}", bWasSuccessful ? "[SUCCESS]" : "[FAILED]", Branch); Message.Body = MessageBody; /*Attachment Attach = new Attachment(); * Message.Attachments.Add()*/ try { #pragma warning disable CS0618 // Mono 4.6.x obsoletes this class SmtpClient MailClient = new SmtpClient("smtp.epicgames.net"); MailClient.Send(Message); #pragma warning restore CS0618 } catch (Exception Ex) { LogError("Failed to send notify email to {0} ({1})", String.Join(", ", StakeholdersEmailAddresses.ToArray()), Ex.Message); } }
public static void CopySharedCookedBuildForTarget(string ProjectFullPath, UnrealTargetPlatform TargetPlatform, string CookPlatform, bool bOnlyCopyAssetRegistry = false) { var LocalPath = CommandUtils.CombinePaths(Path.GetDirectoryName(ProjectFullPath), "Saved", "SharedIterativeBuild", CookPlatform); FileReference ProjectFileRef = new FileReference(ProjectFullPath); // get network location ConfigHierarchy Hierarchy = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromFile(ProjectFileRef), TargetPlatform); List <string> CookedBuildPaths; if (Hierarchy.GetArray("SharedCookedBuildSettings", "SharedCookedBuildPath", out CookedBuildPaths) == false) { CommandUtils.Log("Unable to copy shared cooked build: SharedCookedBuildPath not set in Engine.ini SharedCookedBuildSettings"); return; } foreach (var CookedBuildPath in CookedBuildPaths) { if (CopySharedCookedBuildForTargetInternal(CookedBuildPath, CookPlatform, LocalPath, bOnlyCopyAssetRegistry) == true) { return; } } return; }
public MLSDK(ReadOnlyTargetRules Target) : base(Target) { // Needed for FVector, FQuat and FTransform used in MagicLeapMath.h PrivateDependencyModuleNames.Add("Core"); // Include headers to be public to other modules. PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public")); Type = ModuleType.External; string MLSDKPath = System.Environment.GetEnvironmentVariable("MLSDK"); bool bIsMLSDKInstalled = false; if (MLSDKPath != null) { string IncludePath = Path.Combine(MLSDKPath, "include"); string LibraryPath = Path.Combine(MLSDKPath, "lib"); string LibraryPlatformFolder = string.Empty; switch (Target.Platform) { case UnrealTargetPlatform.Win64: LibraryPlatformFolder = "win64"; break; case UnrealTargetPlatform.Mac: LibraryPlatformFolder = "osx"; break; case UnrealTargetPlatform.Linux: LibraryPlatformFolder = "linux64"; break; case UnrealTargetPlatform.Lumin: LibraryPlatformFolder = "lumin"; break; } LibraryPath = Path.Combine(LibraryPath, LibraryPlatformFolder); bIsMLSDKInstalled = Directory.Exists(IncludePath) && Directory.Exists(LibraryPath); if (bIsMLSDKInstalled) { string ProjectFileName = null != Target.ProjectFile ? Target.ProjectFile.FullName : ""; DirectoryReference ProjectDir = string.IsNullOrEmpty(ProjectFileName) ? (DirectoryReference)null : Target.ProjectFile.Directory; ConfigHierarchy Ini = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, ProjectDir, Target.Platform); PublicIncludePaths.Add(IncludePath); if (Target.Platform != UnrealTargetPlatform.Lumin) { string VirtualDeviceIncludePath = ""; if (Ini.TryGetValue("MLSDK", "IncludePath", out VirtualDeviceIncludePath)) { PublicIncludePaths.Add(VirtualDeviceIncludePath); } } //PublicIncludePaths.Add(Path.Combine(MLSDKPath, "lumin/usr/include/vulkan")); PublicIncludePaths.Add(Target.UEThirdPartySourceDirectory + "Vulkan/Include/vulkan"); string MLSDKLibraryPath = ""; Ini.TryGetValue("MLSDK", "LibraryPath", out MLSDKLibraryPath); PublicLibraryPaths.Add(LibraryPath); if (!string.IsNullOrEmpty(MLSDKLibraryPath)) { PublicLibraryPaths.Add(MLSDKLibraryPath); } string[] MLSDKLibraryList = new string[] { "ml_audio", "ml_camera_metadata", "ml_camera", "ml_dispatch", "ml_ext_logging", "ml_graphics", "ml_graphics_utils", "ml_identity", "ml_input", "ml_lifecycle", "ml_mediacodeclist", "ml_mediacodec", "ml_mediacrypto", "ml_mediadrm", "ml_mediaerror", "ml_mediaextractor", "ml_mediaformat", "ml_mediaplayer", "ml_musicservice", "ml_perception_client", "ml_privileges", "ml_screens", "ml_secure_storage", "ml_sharedfile", "ml_purchase" }; if (Target.Platform == UnrealTargetPlatform.Win64) { foreach (string libname in MLSDKLibraryList) { PublicAdditionalLibraries.Add(string.Format("{0}.lib", libname)); PublicDelayLoadDLLs.Add(string.Format("{0}.dll", libname)); } PublicAdditionalLibraries.Add("ml_remote.lib"); PublicDelayLoadDLLs.Add("ml_remote.dll"); } else if (Target.Platform == UnrealTargetPlatform.Mac) { foreach (string libname in MLSDKLibraryList) { string lib = string.Format("lib{0}.dylib", libname); if (!string.IsNullOrEmpty(MLSDKLibraryPath) && File.Exists(Path.Combine(MLSDKLibraryPath, lib))) { PublicDelayLoadDLLs.Add(Path.Combine(MLSDKLibraryPath, lib)); } else { PublicDelayLoadDLLs.Add(Path.Combine(LibraryPath, lib)); } } string virtualDeviceLib = "libml_remote.dylib"; if (!string.IsNullOrEmpty(MLSDKLibraryPath) && File.Exists(Path.Combine(MLSDKLibraryPath, virtualDeviceLib))) { PublicDelayLoadDLLs.Add(Path.Combine(MLSDKLibraryPath, virtualDeviceLib)); } } else if (Target.Platform == UnrealTargetPlatform.Linux) { foreach (string libname in MLSDKLibraryList) { string lib = string.Format("lib{0}.so", libname); if (!string.IsNullOrEmpty(MLSDKLibraryPath) && File.Exists(Path.Combine(MLSDKLibraryPath, lib))) { PublicDelayLoadDLLs.Add(Path.Combine(MLSDKLibraryPath, lib)); } else { PublicDelayLoadDLLs.Add(Path.Combine(LibraryPath, lib)); } } string virtualDeviceLib = "libml_remote.so"; if (!string.IsNullOrEmpty(MLSDKLibraryPath) && File.Exists(Path.Combine(MLSDKLibraryPath, virtualDeviceLib))) { PublicDelayLoadDLLs.Add(Path.Combine(MLSDKLibraryPath, virtualDeviceLib)); } } else if (Target.Platform == UnrealTargetPlatform.Lumin) { foreach (string libname in MLSDKLibraryList) { PublicAdditionalLibraries.Add(libname); PublicDelayLoadDLLs.Add(string.Format("lib{0}.so", libname)); } } } } PublicDefinitions.Add("WITH_MLSDK=" + (bIsMLSDKInstalled ? "1" : "0")); }
private bool ConnectCentralConfig() { log.DebugFormat("Central config connection string: {0}", CentralConfigServerName); try { // If we are creating the configuration component from within this app // we inherit the application hierarchy, so first we must create the hierarchy. string ccConnectString = dbConnections[CentralConfigServerName].ConnectString; CentralConfig.InitializeApp(ccConnectString, true, "global", CentralConfig.MakeAppGroupLevel("METATAGS"), CentralConfig.MakeAppGroupLevel("METATAGS\\Environment"), CentralConfig.MakeAppGroupLevel("METATAGS\\RuntimeOnly"), CentralConfig.MakeAppLevel("BITS_UI"), CentralConfig.MakeAppLevel("BITS_JOB_SPEC"), CentralConfig.MakeAppLevel("BITS_JOB_GROUP"), CentralConfig.MakeUserLevel(Environment.UserName).ToLower()); hierarchy = CentralConfig.App; List<string> jobGroups = (List<string>)Hierarchy.LevelNames("app\\BITS_JOB_GROUP"); foreach (string jobGroup in jobGroups) { try { string to = String.Empty; Hierarchy.TryGetValueAtLevel("app\\BITS_JOB_GROUP", jobGroup, out to); if (to.Equals(String.Empty) == false) GuiGroupMapping[jobGroup.ToUpper()] = to; } catch (Exception ex) { log.Debug(ex); } } } catch (Exception ex) { log.Error(ex); return false; } return true; }
protected void GenerateFileFromTemplate(string InTemplateFile, string InOutputFile, ProjectParams Params, ConfigHierarchy ConfigCache) { bool IsContentOnly = !Params.IsCodeBasedProject; string ProjectConfiguration = Params.ClientConfigsToBuild[0].ToString(); string UE4GameName = IsContentOnly ? "UE4Game" : Params.ShortProjectName; string ProjectName = Params.ShortProjectName; if (ProjectConfiguration != "Development") { UE4GameName += "-HTML5-" + ProjectConfiguration; ProjectName += "-HTML5-" + ProjectConfiguration; } string CanvasScaleMode; ConfigCache.GetString("/Script/HTML5PlatformEditor.HTML5TargetSettings", "CanvasScalingMode", out CanvasScaleMode); string HeapSize = HTML5SDKInfo.HeapSize(ConfigCache, ProjectConfiguration).ToString(); StringBuilder outputContents = new StringBuilder(); using (StreamReader reader = new StreamReader(InTemplateFile)) { string LineStr = null; while (reader.Peek() != -1) { LineStr = reader.ReadLine(); if (LineStr.Contains("%TIMESTAMP%")) { string TimeStamp = DateTime.UtcNow.ToString("yyyyMMddHHmm"); LineStr = LineStr.Replace("%TIMESTAMP%", TimeStamp); } if (LineStr.Contains("%SHORTNAME%")) { LineStr = LineStr.Replace("%SHORTNAME%", Params.ShortProjectName); } if (LineStr.Contains("%UE4GAMENAME%")) { LineStr = LineStr.Replace("%UE4GAMENAME%", UE4GameName); } if (LineStr.Contains("%PROJECTNAME%")) { LineStr = LineStr.Replace("%PROJECTNAME%", ProjectName); } if (LineStr.Contains("%SERVE_COMPRESSED%")) { LineStr = LineStr.Replace("%SERVE_COMPRESSED%", Compressed ? "true" : "false"); } if (LineStr.Contains("%DISABLE_INDEXEDDB%")) { LineStr = LineStr.Replace("%DISABLE_INDEXEDDB%", enableIndexedDB ? "" : "enableReadFromIndexedDB = false;\nenableWriteToIndexedDB = false;"); } if (LineStr.Contains("%HEAPSIZE%")) { LineStr = LineStr.Replace("%HEAPSIZE%", HeapSize + " * 1024 * 1024"); } if (LineStr.Contains("%UE4CMDLINE%")) { string ArgumentString = "'../../../" + Params.ShortProjectName + "/" + Params.ShortProjectName + ".uproject',"; ArgumentString += "'-stdout',"; // suppress double printing to console.log LineStr = LineStr.Replace("%UE4CMDLINE%", ArgumentString); } if (LineStr.Contains("%CANVASSCALEMODE%")) { string mode = "2 /*ASPECT*/"; // default if (CanvasScaleMode.Equals("stretch", StringComparison.InvariantCultureIgnoreCase)) { mode = "1 /*STRETCH*/"; } else if (CanvasScaleMode.Equals("fixed", StringComparison.InvariantCultureIgnoreCase)) { mode = "3 /*FIXED*/"; } LineStr = LineStr.Replace("%CANVASSCALEMODE%", mode); } outputContents.AppendLine(LineStr); } } if (outputContents.Length > 0) { // Save the file try { Directory.CreateDirectory(Path.GetDirectoryName(InOutputFile)); File.WriteAllText(InOutputFile, outputContents.ToString(), Encoding.UTF8); } catch (Exception) { // Unable to write to the project file. } } }
public override void Package(ProjectParams Params, DeploymentContext SC, int WorkingCL) { LogInformation("Package {0}", Params.RawProjectPath); LogInformation("Setting Emscripten SDK for packaging.."); HTML5SDKInfo.SetupEmscriptenTemp(); HTML5SDKInfo.SetUpEmscriptenConfigFile(); // ---------------------------------------- // ini configurations ConfigHierarchy ConfigCache = UnrealBuildTool.ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromFile(Params.RawProjectPath), UnrealTargetPlatform.HTML5); // Debug and Development builds are not compressed to: // - speed up iteration times // - ensure (IndexedDB) data are not cached/used // Shipping builds "can be": // - compressed // - (IndexedDB) cached string ProjectConfiguration = Params.ClientConfigsToBuild[0].ToString(); if (ProjectConfiguration == "Shipping") { ConfigCache.GetBool("/Script/HTML5PlatformEditor.HTML5TargetSettings", "Compressed", out Compressed); ConfigCache.GetBool("/Script/HTML5PlatformEditor.HTML5TargetSettings", "EnableIndexedDB", out enableIndexedDB); } LogInformation("HTML5Platform.Automation: Compressed = " + Compressed); LogInformation("HTML5Platform.Automation: EnableIndexedDB = " + enableIndexedDB); // ---------------------------------------- // package directory string PackagePath = Path.Combine(Path.GetDirectoryName(Params.RawProjectPath.FullName), "Binaries", "HTML5"); if (!Directory.Exists(PackagePath)) { Directory.CreateDirectory(PackagePath); } string _ProjectNameExtra = ProjectConfiguration != "Development" ? "-HTML5-" + ProjectConfiguration : ""; string _ProjectFullpath = Params.GetProjectExeForPlatform(UnrealTargetPlatform.HTML5).ToString(); string _ProjectFilename = Path.GetFileNameWithoutExtension(_ProjectFullpath) + _ProjectNameExtra; string SrcUE4GameBasename = Path.Combine(Path.GetDirectoryName(_ProjectFullpath), _ProjectFilename); string UE4GameBasename = Path.Combine(PackagePath, _ProjectFilename); string ProjectBasename = Path.Combine(PackagePath, Params.ShortProjectName + _ProjectNameExtra); // ---------------------------------------- // packaging if (HTMLPakAutomation.CanCreateMapPaks(Params)) { HTMLPakAutomation PakAutomation = new HTMLPakAutomation(Params, SC); // Create Necessary Paks. PakAutomation.CreateEnginePak(); PakAutomation.CreateGamePak(); PakAutomation.CreateContentDirectoryPak(); // Create Emscripten Package from Necessary Paks. - This will be the VFS. PakAutomation.CreateEmscriptenDataPackage(PackagePath, ProjectBasename + ".data"); // Create All Map Paks which will be downloaded on the fly. PakAutomation.CreateMapPak(); // Create Delta Paks if setup. List <string> Paks = new List <string>(); ConfigCache.GetArray("/Script/HTML5PlatformEditor.HTML5TargetSettings", "LevelTransitions", out Paks); if (Paks != null) { foreach (var Pak in Paks) { var Matched = Regex.Matches(Pak, "\"[^\"]+\"", RegexOptions.IgnoreCase); string MapFrom = Path.GetFileNameWithoutExtension(Matched[0].ToString().Replace("\"", "")); string MapTo = Path.GetFileNameWithoutExtension(Matched[1].ToString().Replace("\"", "")); PakAutomation.CreateDeltaMapPaks(MapFrom, MapTo); } } } else { // we need to operate in the root string PythonPath = HTML5SDKInfo.Python(); string EmPackagerPath = HTML5SDKInfo.EmscriptenPackager(); using (new ScopedEnvVar("EM_CONFIG", HTML5SDKInfo.DOT_EMSCRIPTEN)) { using (new PushedDirectory(Path.Combine(Params.BaseStageDirectory, "HTML5"))) { string CmdLine = string.Format("\"{0}\" \"{1}\" --preload . --js-output=\"{1}.js\" --no-heap-copy", EmPackagerPath, ProjectBasename + ".data"); RunAndLog(CmdEnv, PythonPath, CmdLine); } } } // ---------------------------------------- // copy to package directory // ensure the ue4game binary exists, if applicable if (!FileExists_NoExceptions(SrcUE4GameBasename + ".js")) { LogInformation("Failed to find game application " + SrcUE4GameBasename + ".js"); throw new AutomationException(ExitCode.Error_MissingExecutable, "Stage Failed. Could not find application {0}. You may need to build the UE4 project with your target configuration and platform.", SrcUE4GameBasename + ".js"); } if (!Params.IsCodeBasedProject) { // template project - need to copy over UE4Game.* File.Copy(SrcUE4GameBasename + ".wasm", UE4GameBasename + ".wasm", true); File.Copy(SrcUE4GameBasename + ".js", UE4GameBasename + ".js", true); File.Copy(SrcUE4GameBasename + ".js.symbols", UE4GameBasename + ".js.symbols", true); File.SetAttributes(UE4GameBasename + ".wasm", FileAttributes.Normal); File.SetAttributes(UE4GameBasename + ".js", FileAttributes.Normal); File.SetAttributes(UE4GameBasename + ".js.symbols", FileAttributes.Normal); } // else, c++ projects will compile "to" PackagePath // note: ( ProjectBasename + ".data" ) already created above (!HTMLPakAutomation.CanCreateMapPaks()) // ---------------------------------------- // generate HTML files to the package directory // custom HTML, JS (if any), and CSS (if any) template files string LocalBuildPath = CombinePaths(CmdEnv.LocalRoot, "Engine/Build/HTML5"); string BuildPath = Path.Combine(Path.GetDirectoryName(Params.RawProjectPath.FullName), "Build", "HTML5"); string TemplateFile = CombinePaths(BuildPath, "project_template.html"); if (!File.Exists(TemplateFile)) { // fall back to default UE4 template files BuildPath = LocalBuildPath; TemplateFile = CombinePaths(BuildPath, "project_template.html"); } GenerateFileFromTemplate(TemplateFile, ProjectBasename + ".html", Params, ConfigCache); TemplateFile = CombinePaths(BuildPath, "project_template.js"); if (File.Exists(TemplateFile)) { GenerateFileFromTemplate(TemplateFile, ProjectBasename + ".UE4.js", Params, ConfigCache); } TemplateFile = CombinePaths(BuildPath, "project_template.css"); if (File.Exists(TemplateFile)) { GenerateFileFromTemplate(TemplateFile, ProjectBasename + ".css", Params, ConfigCache); } // ---------------------------------------- // (development) support files string MacBashTemplateFile = CombinePaths(LocalBuildPath, "RunMacHTML5LaunchHelper_template.command"); string MacBashOutputFile = Path.Combine(PackagePath, "RunMacHTML5LaunchHelper.command"); string MonoPath = CombinePaths(CmdEnv.LocalRoot, "Engine/Build/BatchFiles/Mac/SetupMono.sh"); GenerateMacCommandFromTemplate(MacBashTemplateFile, MacBashOutputFile, MonoPath); // ........................................ string htaccesspath = Path.Combine(PackagePath, ".htaccess"); if (File.Exists(htaccesspath)) { FileAttributes attributes = File.GetAttributes(htaccesspath); if ((attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) { attributes &= ~FileAttributes.ReadOnly; File.SetAttributes(htaccesspath, attributes); } } File.Copy(CombinePaths(LocalBuildPath, "htaccess_template.txt"), htaccesspath, true); // ---------------------------------------- // final copies // Gather utlity .js files and combine into one file string DestinationFile = PackagePath + "/Utility.js"; File.Delete(DestinationFile); // spelling this out - one file at a time (i.e. don't slurp in project_template.js) File.AppendAllText(DestinationFile, File.ReadAllText(CombinePaths(LocalBuildPath, "json2.js"))); File.AppendAllText(DestinationFile, File.ReadAllText(CombinePaths(LocalBuildPath, "jstorage.js"))); File.AppendAllText(DestinationFile, File.ReadAllText(CombinePaths(LocalBuildPath, "moz_binarystring.js"))); if (Compressed) { LogInformation("Build configuration is " + ProjectConfiguration + ", so (gzip) compressing files for web servers."); // Compress all files. These are independent tasks which can be threaded. List <Task> CompressionTasks = new List <Task>(); CompressionTasks.Add(Task.Factory.StartNew(() => CompressFile(UE4GameBasename + ".wasm", UE4GameBasename + ".wasmgz"))); // main game code CompressionTasks.Add(Task.Factory.StartNew(() => CompressFile(UE4GameBasename + ".js", UE4GameBasename + ".jsgz"))); // main js (emscripten) CompressionTasks.Add(Task.Factory.StartNew(() => CompressFile(UE4GameBasename + ".js.symbols", UE4GameBasename + ".js.symbolsgz"))); // symbols fil. CompressionTasks.Add(Task.Factory.StartNew(() => CompressFile(PackagePath + "/Utility.js", PackagePath + "/Utility.jsgz"))); // Utility CompressionTasks.Add(Task.Factory.StartNew(() => CompressFile(ProjectBasename + ".data", ProjectBasename + ".datagz"))); // DATA file CompressionTasks.Add(Task.Factory.StartNew(() => CompressFile(ProjectBasename + ".data.js", ProjectBasename + ".data.jsgz"))); // DATA file .js driver (emscripten) if (File.Exists(ProjectBasename + ".UE4.js")) { CompressionTasks.Add(Task.Factory.StartNew(() => CompressFile(ProjectBasename + ".UE4.js", ProjectBasename + ".UE4.jsgz"))); // UE4 js } if (File.Exists(ProjectBasename + ".css")) { CompressionTasks.Add(Task.Factory.StartNew(() => CompressFile(ProjectBasename + ".css", ProjectBasename + ".cssgz"))); // UE4 css } Task.WaitAll(CompressionTasks.ToArray()); } else { LogInformation("Build configuration is " + ProjectConfiguration + ", so not compressing. Build Shipping configuration to compress files to save space."); // nuke old compressed files to prevent using stale files File.Delete(UE4GameBasename + ".wasmgz"); File.Delete(UE4GameBasename + ".jsgz"); File.Delete(UE4GameBasename + ".js.symbolsgz"); File.Delete(PackagePath + "/Utility.jsgz"); File.Delete(ProjectBasename + ".datagz"); File.Delete(ProjectBasename + ".data.jsgz"); File.Delete(ProjectBasename + ".UE4.jsgz"); File.Delete(ProjectBasename + ".cssgz"); } File.Copy(CombinePaths(CmdEnv.LocalRoot, "Engine/Binaries/DotNET/HTML5LaunchHelper.exe"), CombinePaths(PackagePath, "HTML5LaunchHelper.exe"), true); // Task.WaitAll(CompressionTasks); PrintRunTime(); }
public PrFirebase(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; ConfigHierarchy EngineConfig = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromFile(Target.ProjectFile), Target.Platform); bool bFirebaseLoggingInShipping = false; EngineConfig.TryGetValue("/Script/PrFirebase.PrFirebaseSettings", "bFirebaseLoggingInShipping", out bFirebaseLoggingInShipping); bool bFirebaseEnable = false; bool bFirebaseCrashlyticsEnable = false; bool bFirebaseRemoteConfigEnable = false; bool bFirebaseAuthEnable = false; bool bFirebasePerformanceEnable = false; bool bFirebaseAppDistributionEnable = false; EngineConfig.TryGetValue("/Script/PrFirebase.PrFirebaseSettings", "bFirebaseEnable", out bFirebaseEnable); EngineConfig.TryGetValue("/Script/PrFirebase.PrFirebaseSettings", "bFirebaseCrashlyticsEnable", out bFirebaseCrashlyticsEnable); EngineConfig.TryGetValue("/Script/PrFirebase.PrFirebaseSettings", "bFirebaseRemoteConfigEnable", out bFirebaseRemoteConfigEnable); EngineConfig.TryGetValue("/Script/PrFirebase.PrFirebaseSettings", "bFirebaseAuthEnable", out bFirebaseAuthEnable); EngineConfig.TryGetValue("/Script/PrFirebase.PrFirebaseSettings", "bFirebasePerformanceEnable", out bFirebasePerformanceEnable); EngineConfig.TryGetValue("/Script/PrFirebase.PrFirebaseSettings", "bFirebaseAppDistributionEnable", out bFirebaseAppDistributionEnable); PrivateIncludePaths.AddRange( new string[] { "PrFirebase/Private" }); PublicDependencyModuleNames.AddRange( new string[] { "Core", "CoreUObject", "Engine", "RenderCore", "RHI" }); PrivateIncludePathModuleNames.AddRange( new string[] { "Settings", } ); bool bSymbolsWarning = false; if (bFirebaseEnable) { if (Target.Platform == UnrealTargetPlatform.IOS) { bool bGeneratedSYMBundle = false; bool bGeneratedSYMFile = false; EngineConfig.TryGetValue("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bGeneratedSYMBundle", out bGeneratedSYMBundle); EngineConfig.TryGetValue("/Script/IOSRuntimeSettings.IOSRuntimeSettings", "bGeneratedSYMFile", out bGeneratedSYMFile); if ((!bGeneratedSYMBundle || !bGeneratedSYMFile) && bFirebaseCrashlyticsEnable) { bSymbolsWarning = true; } /* Firebase / Firebase Analytics */ PublicAdditionalFrameworks.Add( new Framework( "FirebaseAnalytics", "../../ThirdParty/iOS/FirebaseAnalytics.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "FirebaseCore", "../../ThirdParty/iOS/FirebaseCore.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "FirebaseCoreDiagnostics", "../../ThirdParty/iOS/FirebaseCoreDiagnostics.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "FirebaseInstallations", "../../ThirdParty/iOS/FirebaseInstallations.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "GoogleAppMeasurement", "../../ThirdParty/iOS/GoogleAppMeasurement.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "GoogleDataTransport", "../../ThirdParty/iOS/GoogleDataTransport.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "GoogleUtilities", "../../ThirdParty/iOS/GoogleUtilities.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "nanopb", "../../ThirdParty/iOS/nanopb.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "PromisesObjC", "../../ThirdParty/iOS/PromisesObjC.embeddedframework.zip" ) ); /* Crashlytics */ if (bFirebaseCrashlyticsEnable) { PublicAdditionalFrameworks.Add( new Framework( "FirebaseCrashlytics", "../../ThirdParty/iOS/FirebaseCrashlytics.embeddedframework.zip" ) ); } /* Remote Config */ if (bFirebaseRemoteConfigEnable) { PublicAdditionalFrameworks.Add( new Framework( "FirebaseABTesting", "../../ThirdParty/iOS/FirebaseABTesting.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "FirebaseRemoteConfig", "../../ThirdParty/iOS/FirebaseRemoteConfig.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "Protobuf", "../../ThirdParty/iOS/Protobuf.embeddedframework.zip" ) ); } /* Performance */ if (bFirebasePerformanceEnable) { PublicAdditionalFrameworks.Add( new Framework( "FirebaseABTesting", "../../ThirdParty/iOS/FirebaseABTesting.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "FirebasePerformance", "../../ThirdParty/iOS/FirebasePerformance.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "FirebaseRemoteConfig", "../../ThirdParty/iOS/FirebaseRemoteConfig.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "Protobuf", "../../ThirdParty/iOS/Protobuf.embeddedframework.zip" ) ); } /* Auth */ if (bFirebaseAuthEnable) { PublicAdditionalFrameworks.Add( new Framework( "FirebaseAuth", "../../ThirdParty/iOS/FirebaseAuth.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "GTMSessionFetcher", "../../ThirdParty/iOS/GTMSessionFetcher.embeddedframework.zip" ) ); } if (bFirebaseAppDistributionEnable) { PublicAdditionalFrameworks.Add( new Framework( "FirebaseAppDistribution", "../../ThirdParty/iOS/FirebaseAppDistribution.embeddedframework.zip" ) ); } PublicSystemLibraries.Add("sqlite3"); PrivateIncludePaths.Add("PrFirebase/External/iOS"); string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath); AdditionalPropertiesForReceipt.Add("IOSPlugin", Path.Combine(PluginPath, "PrFirebase_UPL_IOS.xml")); } else if (Target.Platform == UnrealTargetPlatform.Android) { PublicDependencyModuleNames.AddRange( new string[] { "Launch" }); string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath); AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(PluginPath, "PrFirebase_UPL_Android.xml")); } else { bFirebaseEnable = false; } } PublicDefinitions.Add("WITH_FIREBASE=" + (bFirebaseEnable ? "1" : "0")); PublicDefinitions.Add("WITH_FIREBASE_CRASHLYTICS=" + (bFirebaseEnable && bFirebaseCrashlyticsEnable ? "1" : "0")); PublicDefinitions.Add("WITH_FIREBASE_REMOTECONFIG=" + (bFirebaseEnable && bFirebaseRemoteConfigEnable ? "1" : "0")); PublicDefinitions.Add("WITH_FIREBASE_AUTH=" + (bFirebaseEnable && bFirebaseAuthEnable ? "1" : "0")); PublicDefinitions.Add("WITH_FIREBASE_PERFORMANCE=" + (bFirebaseEnable && bFirebasePerformanceEnable ? "1" : "0")); PublicDefinitions.Add("WITH_FIREBASE_SYMBOLS_WARNING=" + (bFirebaseEnable && bSymbolsWarning ? "1" : "0")); PublicDefinitions.Add("WITH_FIREBASE_APPDISTRIBUTION=" + (bFirebaseEnable && bFirebaseAppDistributionEnable ? "1" : "0")); PublicDefinitions.Add("FIREBASE_LOGGING=" + (bFirebaseLoggingInShipping ? "1" : "0")); }
/// <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) { // 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); } } } string TempTargetDir = CommandUtils.CombinePaths(Path.GetDirectoryName(RawProjectPath.FullName), "Intermediate", "Source"); if (RequiresTempTarget(RawProjectPath, TargetPlatforms, TargetConfigurations, 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 static bool LoadBundleConfig(string BundleIniFile, ref Dictionary <string, BundleSettings> Bundles) { if (System.IO.File.Exists(BundleIniFile) == false) { CommandUtils.LogWarning("Unable to find bundle config ini file {0}", BundleIniFile); return(false); } FileReference BundleFileReference = new FileReference(BundleIniFile); ConfigHierarchy BundleConfig = new ConfigHierarchy(new ConfigFile[] { new ConfigFile(BundleFileReference) }); int PriorityCounter = 0; foreach (string SectionName in BundleConfig.SectionNames) { BundleSettings Bundle = new BundleSettings(); Bundle.Name = SectionName; Bundle.Priority = PriorityCounter; ++PriorityCounter; { string OverrideName; if (BundleConfig.GetString(SectionName, "OverrideName", out OverrideName)) { Bundle.OverrideName = OverrideName; } else { Bundle.OverrideName = Bundle.Name; } } { string ParentName; BundleConfig.GetString(SectionName, "Parent", out ParentName); Bundle.ParentName = ParentName; } { List <string> Tags; BundleConfig.GetArray(SectionName, "Tags", out Tags); Bundle.Tags = Tags; } { List <string> FileRegex; BundleConfig.GetArray(SectionName, "FileRegex", out FileRegex); Bundle.FileRegex = FileRegex; } { bool bContainsShaderLibrary; BundleConfig.GetBool(SectionName, "ContainsShaderLibrary", out bContainsShaderLibrary); Bundle.bContainsShaderLibrary = bContainsShaderLibrary; } if (Bundle.Tags == null) { Bundle.Tags = new List <string>(); } Bundles.Add(SectionName, Bundle); //BundleConfig.GetArray(SectionName, "OptionalTags", out Bundle.OptionalTags); } foreach (var BundleIt in Bundles) { BundleSettings Bundle = BundleIt.Value; if (Bundles.ContainsKey(Bundle.ParentName)) { BundleSettings ParentBundle = Bundles[Bundle.ParentName]; ParentBundle.Children.Add(Bundle); Bundle.bFoundParent = true; } } return(true); }
public static void LoadBundleConfig <TPlatformBundleSettings>(DirectoryReference ProjectDir, UnrealTargetPlatform Platform, out IReadOnlyDictionary <string, TPlatformBundleSettings> Bundles, Action <TPlatformBundleSettings, ConfigHierarchy, string> GetPlatformSettings) where TPlatformBundleSettings : BundleSettings, new() { var Results = new List <TPlatformBundleSettings>(); ConfigHierarchy BundleConfig = ConfigCache.ReadHierarchy(ConfigHierarchyType.InstallBundle, ProjectDir, Platform); const string BundleDefinitionPrefix = "InstallBundleDefinition "; foreach (string SectionName in BundleConfig.SectionNames) { if (!SectionName.StartsWith(BundleDefinitionPrefix)) { continue; } TPlatformBundleSettings Bundle = new TPlatformBundleSettings(); Bundle.Name = SectionName.Substring(BundleDefinitionPrefix.Length); { int Order; if (BundleConfig.GetInt32(SectionName, "Order", out Order)) { Bundle.Order = Order; } else { Bundle.Order = int.MaxValue; } } { List <string> Tags; if (BundleConfig.GetArray(SectionName, "Tags", out Tags)) { Bundle.Tags = Tags; } else { Bundle.Tags = new List <string>(); } } { List <string> Dependencies; if (BundleConfig.GetArray(SectionName, "Dependencies", out Dependencies)) { Bundle.Dependencies = Dependencies; } else { Bundle.Dependencies = new List <string>(); } } { List <string> FileRegex; if (BundleConfig.GetArray(SectionName, "FileRegex", out FileRegex)) { Bundle.FileRegex = FileRegex; } else { Bundle.FileRegex = new List <string>(); } } { bool bContainsShaderLibrary; if (BundleConfig.GetBool(SectionName, "ContainsShaderLibrary", out bContainsShaderLibrary)) { Bundle.bContainsShaderLibrary = bContainsShaderLibrary; } else { Bundle.bContainsShaderLibrary = false; } } GetPlatformSettings(Bundle, BundleConfig, BundleDefinitionPrefix + Bundle.Name); Results.Add(Bundle); } // Use OrderBy and not Sort because OrderBy is stable Bundles = Results.OrderBy(b => b.Order).ToDictionary(b => b.Name, b => b); }
public DeploymentContext( FileReference RawProjectPathOrName, string InLocalRoot, string BaseStageDirectory, string BaseArchiveDirectory, Platform InSourcePlatform, Platform InTargetPlatform, List <UnrealTargetConfiguration> InTargetConfigurations, IEnumerable <StageTarget> InStageTargets, List <String> InStageExecutables, bool InServer, bool InCooked, bool InStageCrashReporter, bool InStage, bool InCookOnTheFly, bool InArchive, bool InProgram, bool IsClientInsteadOfNoEditor, bool InForceChunkManifests, bool bInUseWebsocketNetDriver = false ) { bStageCrashReporter = InStageCrashReporter; RawProjectPath = RawProjectPathOrName; DedicatedServer = InServer; LocalRoot = CommandUtils.CombinePaths(InLocalRoot); CookSourcePlatform = InSourcePlatform; StageTargetPlatform = InTargetPlatform; StageTargetConfigurations = new List <UnrealTargetConfiguration>(InTargetConfigurations); StageTargets = new List <StageTarget>(InStageTargets); StageExecutables = InStageExecutables; IsCodeBasedProject = ProjectUtils.IsCodeBasedUProjectFile(RawProjectPath); ShortProjectName = ProjectUtils.GetShortProjectName(RawProjectPath); Stage = InStage; Archive = InArchive; bUseWebsocketNetDriver = bInUseWebsocketNetDriver; if (CookSourcePlatform != null && InCooked) { CookPlatform = CookSourcePlatform.GetCookPlatform(DedicatedServer, IsClientInsteadOfNoEditor); } else if (CookSourcePlatform != null && InProgram) { CookPlatform = CookSourcePlatform.GetCookPlatform(false, false); } else { CookPlatform = ""; } if (StageTargetPlatform != null && InCooked) { FinalCookPlatform = StageTargetPlatform.GetCookPlatform(DedicatedServer, IsClientInsteadOfNoEditor); } else if (StageTargetPlatform != null && InProgram) { FinalCookPlatform = StageTargetPlatform.GetCookPlatform(false, false); } else { FinalCookPlatform = ""; } PlatformDir = StageTargetPlatform.PlatformType.ToString(); StageDirectory = CommandUtils.CombinePaths(BaseStageDirectory, FinalCookPlatform); ArchiveDirectory = CommandUtils.CombinePaths(BaseArchiveDirectory, FinalCookPlatform); if (!CommandUtils.FileExists(RawProjectPath.FullName)) { throw new AutomationException("Can't find uproject file {0}.", RawProjectPathOrName); } ProjectRoot = CommandUtils.CombinePaths(CommandUtils.GetDirectoryName(RawProjectPath.FullName)); if (!CommandUtils.DirectoryExists(ProjectRoot)) { throw new AutomationException("Project Directory {0} doesn't exist.", ProjectRoot); } RelativeProjectRootForStage = ShortProjectName; ProjectArgForCommandLines = CommandUtils.MakePathSafeToUseWithCommandLine(RawProjectPath.FullName); CookSourceRuntimeRootDir = RuntimeRootDir = LocalRoot; RuntimeProjectRootDir = ProjectRoot; RelativeProjectRootForUnrealPak = CommandUtils.CombinePaths(RelativeProjectRootForStage).Replace("\\", "/"); if (RelativeProjectRootForUnrealPak.StartsWith("/")) { RelativeProjectRootForUnrealPak = RelativeProjectRootForUnrealPak.Substring(1); RelativeProjectRootForStage = RelativeProjectRootForStage.Substring(1); } SourceRelativeProjectRoot = RelativeProjectRootForStage; // for foreign projects this doesn't make much sense, but it turns into a noop on staging files if (ProjectRoot.StartsWith(LocalRoot, StringComparison.InvariantCultureIgnoreCase)) { SourceRelativeProjectRoot = ProjectRoot.Substring(LocalRoot.Length); } if (SourceRelativeProjectRoot.StartsWith("/") || SourceRelativeProjectRoot.StartsWith("\\")) { SourceRelativeProjectRoot = SourceRelativeProjectRoot.Substring(1); } if (Stage) { CommandUtils.CreateDirectory(StageDirectory); StageProjectRoot = CommandUtils.CombinePaths(StageDirectory, RelativeProjectRootForStage); RuntimeRootDir = StageDirectory; CookSourceRuntimeRootDir = CommandUtils.CombinePaths(BaseStageDirectory, CookPlatform); RuntimeProjectRootDir = StageProjectRoot; ProjectArgForCommandLines = CommandUtils.MakePathSafeToUseWithCommandLine(UProjectCommandLineArgInternalRoot + RelativeProjectRootForStage + "/" + ShortProjectName + ".uproject"); } if (Archive) { CommandUtils.CreateDirectory(ArchiveDirectory); } ProjectArgForCommandLines = ProjectArgForCommandLines.Replace("\\", "/"); ProjectBinariesFolder = CommandUtils.CombinePaths(ProjectUtils.GetClientProjectBinariesRootPath(RawProjectPath, TargetRules.TargetType.Game, IsCodeBasedProject), PlatformDir); // If we were configured to use manifests across the whole project, then this platform should use manifests. // Otherwise, read whether we are generating chunks from the ProjectPackagingSettings ini. if (InForceChunkManifests) { PlatformUsesChunkManifests = true; } else { ConfigHierarchy GameIni = ConfigCache.ReadHierarchy(ConfigHierarchyType.Game, RawProjectPath.Directory, InTargetPlatform.PlatformType); String IniPath = "/Script/UnrealEd.ProjectPackagingSettings"; bool bSetting = false; if (GameIni.GetBool(IniPath, "bGenerateChunks", out bSetting)) { PlatformUsesChunkManifests = bSetting; } } }
public DeploymentContext( FileReference RawProjectPathOrName, DirectoryReference InLocalRoot, DirectoryReference BaseStageDirectory, DirectoryReference BaseArchiveDirectory, Platform InSourcePlatform, Platform InTargetPlatform, List <UnrealTargetConfiguration> InTargetConfigurations, IEnumerable <StageTarget> InStageTargets, List <String> InStageExecutables, bool InServer, bool InCooked, bool InStageCrashReporter, bool InStage, bool InCookOnTheFly, bool InArchive, bool InProgram, bool IsClientInsteadOfNoEditor, bool InForceChunkManifests, bool InSeparateDebugStageDirectory ) { bStageCrashReporter = InStageCrashReporter; RawProjectPath = RawProjectPathOrName; DedicatedServer = InServer; LocalRoot = InLocalRoot; CookSourcePlatform = InSourcePlatform; StageTargetPlatform = InTargetPlatform; StageTargetConfigurations = new List <UnrealTargetConfiguration>(InTargetConfigurations); StageTargets = new List <StageTarget>(InStageTargets); StageExecutables = InStageExecutables; IsCodeBasedProject = ProjectUtils.IsCodeBasedUProjectFile(RawProjectPath, StageTargetConfigurations); ShortProjectName = ProjectUtils.GetShortProjectName(RawProjectPath); Stage = InStage; Archive = InArchive; if (CookSourcePlatform != null && InCooked) { CookPlatform = CookSourcePlatform.GetCookPlatform(DedicatedServer, IsClientInsteadOfNoEditor); } else if (CookSourcePlatform != null && InProgram) { CookPlatform = CookSourcePlatform.GetCookPlatform(false, false); } else { CookPlatform = ""; } if (StageTargetPlatform != null && InCooked) { FinalCookPlatform = StageTargetPlatform.GetCookPlatform(DedicatedServer, IsClientInsteadOfNoEditor); } else if (StageTargetPlatform != null && InProgram) { FinalCookPlatform = StageTargetPlatform.GetCookPlatform(false, false); } else { FinalCookPlatform = ""; } PlatformDir = StageTargetPlatform.PlatformType.ToString(); if (BaseStageDirectory != null) { StageDirectory = DirectoryReference.Combine(BaseStageDirectory, FinalCookPlatform); DebugStageDirectory = InSeparateDebugStageDirectory? DirectoryReference.Combine(BaseStageDirectory, FinalCookPlatform + "Debug") : StageDirectory; } if (BaseArchiveDirectory != null) { ArchiveDirectory = DirectoryReference.Combine(BaseArchiveDirectory, FinalCookPlatform); } if (!FileReference.Exists(RawProjectPath)) { throw new AutomationException("Can't find uproject file {0}.", RawProjectPathOrName); } EngineRoot = DirectoryReference.Combine(LocalRoot, "Engine"); ProjectRoot = RawProjectPath.Directory; RelativeProjectRootForStage = new StagedDirectoryReference(ShortProjectName); ProjectArgForCommandLines = CommandUtils.MakePathSafeToUseWithCommandLine(RawProjectPath.FullName); CookSourceRuntimeRootDir = RuntimeRootDir = LocalRoot; RuntimeProjectRootDir = ProjectRoot; if (Stage) { CommandUtils.CreateDirectory(StageDirectory.FullName); RuntimeRootDir = StageDirectory; CookSourceRuntimeRootDir = DirectoryReference.Combine(BaseStageDirectory, CookPlatform); RuntimeProjectRootDir = DirectoryReference.Combine(StageDirectory, RelativeProjectRootForStage.Name); ProjectArgForCommandLines = CommandUtils.MakePathSafeToUseWithCommandLine(UProjectCommandLineArgInternalRoot + RelativeProjectRootForStage.Name + "/" + ShortProjectName + ".uproject"); } if (Archive) { CommandUtils.CreateDirectory(ArchiveDirectory.FullName); } ProjectArgForCommandLines = ProjectArgForCommandLines.Replace("\\", "/"); ProjectBinariesFolder = DirectoryReference.Combine(ProjectUtils.GetClientProjectBinariesRootPath(RawProjectPath, TargetType.Game, IsCodeBasedProject), PlatformDir); // Build a list of restricted folder names. This will comprise all other restricted platforms, plus standard restricted folder names such as NoRedist, NotForLicensees, etc... RestrictedFolderNames.UnionWith(PlatformExports.GetPlatformFolderNames()); foreach (UnrealTargetPlatform StagePlatform in StageTargetPlatform.GetStagePlatforms()) { RestrictedFolderNames.ExceptWith(PlatformExports.GetIncludedFolderNames(StagePlatform)); } RestrictedFolderNames.UnionWith(FileFilter.RestrictedFolderNames); RestrictedFolderNames.Remove(new FileSystemName(StageTargetPlatform.IniPlatformType.ToString())); // Read the game config files ConfigHierarchy GameConfig = ConfigCache.ReadHierarchy(ConfigHierarchyType.Game, ProjectRoot, InTargetPlatform.PlatformType); // Read the list of directories to remap when staging List <string> RemapDirectoriesList; if (GameConfig.GetArray("Staging", "RemapDirectories", out RemapDirectoriesList)) { foreach (string RemapDirectory in RemapDirectoriesList) { Dictionary <string, string> Properties; if (!ConfigHierarchy.TryParse(RemapDirectory, out Properties)) { throw new AutomationException("Unable to parse '{0}'", RemapDirectory); } string FromDir; if (!Properties.TryGetValue("From", out FromDir)) { throw new AutomationException("Missing 'From' property in '{0}'", RemapDirectory); } string ToDir; if (!Properties.TryGetValue("To", out ToDir)) { throw new AutomationException("Missing 'To' property in '{0}'", RemapDirectory); } RemapDirectories.Add(Tuple.Create(new StagedDirectoryReference(FromDir), new StagedDirectoryReference(ToDir))); } } // Read the list of directories to whitelist from restricted folder warnings List <string> WhitelistDirectoriesList; if (GameConfig.GetArray("Staging", "WhitelistDirectories", out WhitelistDirectoriesList)) { foreach (string WhitelistDirectory in WhitelistDirectoriesList) { WhitelistDirectories.Add(new StagedDirectoryReference(WhitelistDirectory)); } } // Read the list of files which are whitelisted to be staged ReadConfigFileList(GameConfig, "Staging", "WhitelistConfigFiles", WhitelistConfigFiles); ReadConfigFileList(GameConfig, "Staging", "BlacklistConfigFiles", BlacklistConfigFiles); // If we were configured to use manifests across the whole project, then this platform should use manifests. // Otherwise, read whether we are generating chunks from the ProjectPackagingSettings ini. if (InForceChunkManifests) { PlatformUsesChunkManifests = true; } else { ConfigHierarchy GameIni = ConfigCache.ReadHierarchy(ConfigHierarchyType.Game, ProjectRoot, InTargetPlatform.PlatformType); String IniPath = "/Script/UnrealEd.ProjectPackagingSettings"; bool bSetting = false; if (GameIni.GetBool(IniPath, "bGenerateChunks", out bSetting)) { PlatformUsesChunkManifests = bSetting; } } }
public DeploymentContext( FileReference RawProjectPathOrName, DirectoryReference InLocalRoot, DirectoryReference BaseStageDirectory, DirectoryReference BaseArchiveDirectory, Platform InSourcePlatform, Platform InTargetPlatform, List <UnrealTargetConfiguration> InTargetConfigurations, IEnumerable <StageTarget> InStageTargets, List <String> InStageExecutables, bool InServer, bool InCooked, bool InStageCrashReporter, bool InStage, bool InCookOnTheFly, bool InArchive, bool InProgram, bool IsClientInsteadOfNoEditor, bool InForceChunkManifests ) { bStageCrashReporter = InStageCrashReporter; RawProjectPath = RawProjectPathOrName; DedicatedServer = InServer; LocalRoot = InLocalRoot; CookSourcePlatform = InSourcePlatform; StageTargetPlatform = InTargetPlatform; StageTargetConfigurations = new List <UnrealTargetConfiguration>(InTargetConfigurations); StageTargets = new List <StageTarget>(InStageTargets); StageExecutables = InStageExecutables; IsCodeBasedProject = ProjectUtils.IsCodeBasedUProjectFile(RawProjectPath); ShortProjectName = ProjectUtils.GetShortProjectName(RawProjectPath); Stage = InStage; Archive = InArchive; if (CookSourcePlatform != null && InCooked) { CookPlatform = CookSourcePlatform.GetCookPlatform(DedicatedServer, IsClientInsteadOfNoEditor); } else if (CookSourcePlatform != null && InProgram) { CookPlatform = CookSourcePlatform.GetCookPlatform(false, false); } else { CookPlatform = ""; } if (StageTargetPlatform != null && InCooked) { FinalCookPlatform = StageTargetPlatform.GetCookPlatform(DedicatedServer, IsClientInsteadOfNoEditor); } else if (StageTargetPlatform != null && InProgram) { FinalCookPlatform = StageTargetPlatform.GetCookPlatform(false, false); } else { FinalCookPlatform = ""; } PlatformDir = StageTargetPlatform.PlatformType.ToString(); if (BaseStageDirectory != null) { StageDirectory = DirectoryReference.Combine(BaseStageDirectory, FinalCookPlatform); } if (BaseArchiveDirectory != null) { ArchiveDirectory = DirectoryReference.Combine(BaseArchiveDirectory, FinalCookPlatform); } if (!FileReference.Exists(RawProjectPath)) { throw new AutomationException("Can't find uproject file {0}.", RawProjectPathOrName); } EngineRoot = DirectoryReference.Combine(LocalRoot, "Engine"); ProjectRoot = RawProjectPath.Directory; RelativeProjectRootForStage = new StagedDirectoryReference(ShortProjectName); ProjectArgForCommandLines = CommandUtils.MakePathSafeToUseWithCommandLine(RawProjectPath.FullName); CookSourceRuntimeRootDir = RuntimeRootDir = LocalRoot; RuntimeProjectRootDir = ProjectRoot; if (Stage) { CommandUtils.CreateDirectory(StageDirectory.FullName); RuntimeRootDir = StageDirectory; CookSourceRuntimeRootDir = DirectoryReference.Combine(BaseStageDirectory, CookPlatform); RuntimeProjectRootDir = DirectoryReference.Combine(StageDirectory, RelativeProjectRootForStage.Name); ProjectArgForCommandLines = CommandUtils.MakePathSafeToUseWithCommandLine(UProjectCommandLineArgInternalRoot + RelativeProjectRootForStage.Name + "/" + ShortProjectName + ".uproject"); } if (Archive) { CommandUtils.CreateDirectory(ArchiveDirectory.FullName); } ProjectArgForCommandLines = ProjectArgForCommandLines.Replace("\\", "/"); ProjectBinariesFolder = DirectoryReference.Combine(ProjectUtils.GetClientProjectBinariesRootPath(RawProjectPath, TargetType.Game, IsCodeBasedProject), PlatformDir); // If we were configured to use manifests across the whole project, then this platform should use manifests. // Otherwise, read whether we are generating chunks from the ProjectPackagingSettings ini. if (InForceChunkManifests) { PlatformUsesChunkManifests = true; } else { ConfigHierarchy GameIni = ConfigCache.ReadHierarchy(ConfigHierarchyType.Game, ProjectRoot, InTargetPlatform.PlatformType); String IniPath = "/Script/UnrealEd.ProjectPackagingSettings"; bool bSetting = false; if (GameIni.GetBool(IniPath, "bGenerateChunks", out bSetting)) { PlatformUsesChunkManifests = bSetting; } } }
public void UploadToS3(DeploymentContext SC, string OutputFilename) { ConfigHierarchy Ini = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromFile(SC.RawProjectPath), SC.StageTargetPlatform.PlatformType); bool Upload = false; string Region = ""; string KeyId = ""; string AccessKey = ""; string BucketName = ""; string FolderName = ""; if (!Ini.GetBool("/Script/HTML5PlatformEditor.HTML5TargetSettings", "UploadToS3", out Upload) || !Upload) { return; } bool AmazonIdentity = Ini.GetString("/Script/HTML5PlatformEditor.HTML5TargetSettings", "S3Region", out Region) && Ini.GetString("/Script/HTML5PlatformEditor.HTML5TargetSettings", "S3KeyID", out KeyId) && Ini.GetString("/Script/HTML5PlatformEditor.HTML5TargetSettings", "S3SecretAccessKey", out AccessKey) && Ini.GetString("/Script/HTML5PlatformEditor.HTML5TargetSettings", "S3BucketName", out BucketName); if (!AmazonIdentity) { Log("Amazon S3 Incorrectly configured"); return; } Ini.GetString("/Script/HTML5PlatformEditor.HTML5TargetSettings", "S3FolderName", out FolderName); if (FolderName == "") { FolderName = SC.ShortProjectName; } else { // strip any before and after folder "/" FolderName = Regex.Replace(Regex.Replace(FolderName, "^/+", ""), "/+$", ""); } List <Task> UploadTasks = new List <Task>(); long msTimeOut = 0; foreach (KeyValuePair <string, string> Entry in SC.ArchivedFiles) { FileInfo Info = new FileInfo(Entry.Key); UploadTasks.Add(UploadToS3Worker(Info, Region, KeyId, AccessKey, BucketName, FolderName)); if (msTimeOut < Info.Length) { msTimeOut = Info.Length; } } msTimeOut /= 100; // [miliseconds] give 10 secs for each ~MB ( (10s * 1000ms) / ( 1024KB * 1024MB * 1000ms ) ) if (msTimeOut < (100 * 1000)) // HttpClient: default timeout is 100 sec { msTimeOut = 100 * 1000; } Log("Upload Timeout set to: " + (msTimeOut / 1000) + "secs"); Task.WaitAll(UploadTasks.ToArray(), (int)msTimeOut); // set timeout [miliseconds] string URL = "https://" + BucketName + ".s3.amazonaws.com/" + FolderName + "/" + OutputFilename; Log("Your project's shareable link is: " + URL); Log("Upload Tasks finished."); }
private static bool FindBestSharedCookedBuild(ref string FinalCookedBuildPath, string ProjectFullPath, UnrealTargetPlatform TargetPlatform, string CookPlatform, string SharedCookedBuildCL) { string BuildRoot = CommandUtils.P4Enabled ? CommandUtils.P4Env.Branch.Replace("/", "+") : ""; int CurrentCLInt = CommandUtils.P4Enabled ? CommandUtils.P4Env.Changelist : 0; BuildVersion Version; if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version)) { CurrentCLInt = Version.Changelist; BuildRoot = Version.BranchName; } System.GC.Collect(); string CurrentCL = CurrentCLInt.ToString(); FileReference ProjectFileRef = new FileReference(ProjectFullPath); // get network location ConfigHierarchy Hierarchy = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromFile(ProjectFileRef), TargetPlatform); List <string> CookedBuildPaths; if (Hierarchy.GetArray("SharedCookedBuildSettings", "SharedCookedBuildPath", out CookedBuildPaths) == false) { CommandUtils.LogInformation("Unable to copy shared cooked build: SharedCookedBuildPath not set in Engine.ini SharedCookedBuildSettings"); return(false); } const string MetaDataFilename = "\\Metadata\\DevelopmentAssetRegistry.bin"; if (SharedCookedBuildCL == "usesyncedbuild") { foreach (string CookedBuildPath in CookedBuildPaths) { if (CurrentCL == "" && FinalCookedBuildPath.Contains("[CL]")) { CommandUtils.LogInformation("Unable to copy shared cooked build: Unable to determine CL number from P4 or UGS, and is required by SharedCookedBuildPath"); return(false); } if (CurrentCL == "" && FinalCookedBuildPath.Contains("[BRANCHNAME]")) { CommandUtils.LogInformation("Unable to copy shared cooked build: Unable to determine BRANCHNAME number from P4 or UGS, and is required by SharedCookedBuildPath"); return(false); } FinalCookedBuildPath = FinalCookedBuildPath.Replace("[CL]", CurrentCL.ToString()); FinalCookedBuildPath = FinalCookedBuildPath.Replace("[BRANCHNAME]", BuildRoot); FinalCookedBuildPath = FinalCookedBuildPath.Replace("[PLATFORM]", CookPlatform); // make sure that the directory and metadata file exist. otherwise this build might not be finished yet and we should skip it if (Directory.Exists(FinalCookedBuildPath)) { if (File.Exists(FinalCookedBuildPath + MetaDataFilename)) { return(true); } } } } else if (SharedCookedBuildCL == "userecentbuild") { // build our CookedBUildPath into a regex which we can execute on the directories and extract info from string BestBuild = null; int BestCLNumber = 0; // find all the recent builds which are valid foreach (string CookedBuildPath in CookedBuildPaths) { int IndexOfFirstParam = CookedBuildPath.IndexOf("["); int CustomFolderStart = CookedBuildPath.LastIndexOf("\\", IndexOfFirstParam); string CookedBuildDirectory = CookedBuildPath.Substring(0, CustomFolderStart); string BuildNameWildcard = CookedBuildPath.Substring(CustomFolderStart); BuildNameWildcard += MetaDataFilename; FileFilter BuildSearch = new FileFilter(); // we know the platform and the branch name; string BuildRule = BuildNameWildcard; BuildRule = BuildRule.Replace("[BRANCHNAME]", BuildRoot); BuildRule = BuildRule.Replace("[PLATFORM]", CookPlatform); string IncludeRule = BuildRule.Replace("[CL]", "*"); string ForgetRule = BuildRule.Replace("[CL]", "*-PF-*"); // get rid of any preflights from the list... they don't count because who knows what they did... BuildSearch.AddRule(IncludeRule); BuildSearch.AddRule(ForgetRule, FileFilterType.Exclude); List <FileReference> ValidBuilds = BuildSearch.ApplyToDirectory(new DirectoryReference(CookedBuildDirectory), false); // figure out what the CL is string BuildNameRegex = String.Format(".*{0}", CookedBuildPath.Substring(CustomFolderStart)); BuildNameRegex = BuildNameRegex.Replace("\\", "\\\\"); BuildNameRegex = BuildNameRegex.Replace("[BRANCHNAME]", BuildRoot); BuildNameRegex = BuildNameRegex.Replace("+", "\\+"); BuildNameRegex = BuildNameRegex.Replace("[PLATFORM]", CookPlatform); BuildNameRegex = BuildNameRegex.Replace("[CL]", "(?<CL>.*)"); Regex ExtractCL = new Regex(BuildNameRegex); foreach (FileReference ValidBuild in ValidBuilds) { string BuildPath = ValidBuild.FullName.Replace(MetaDataFilename, ""); Match CLMatch = ExtractCL.Match(BuildPath); if (CLMatch != null) { string CLNumber = CLMatch.Result("${CL}"); int CLNumberInt = int.Parse(CLNumber); if (CLNumberInt <= CurrentCLInt) { if (CLNumberInt > BestCLNumber) { BestCLNumber = CLNumberInt; BestBuild = BuildPath; } } } } } if (string.IsNullOrEmpty(BestBuild)) { return(false); } FinalCookedBuildPath = BestBuild; return(true); } return(false); }