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 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 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 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")); }
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 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(); }
/// <summary> /// Get a ConfigHierarchy of the type you want with platform-specific config for the given Role. This object can be used to read .ini config values. /// Default params return the client platform's game config. /// This looks for the workspace files for the project that you are trying to run your test on. The config directory for that project must exist to find valid results. /// </summary> public static ConfigHierarchy GetConfigHierarchy(UnrealTestContext TestContext, ConfigHierarchyType ConfigType = ConfigHierarchyType.Game, UnrealTargetRole TargetRole = UnrealTargetRole.Client) { string ProjectPath = Path.Combine(Environment.CurrentDirectory, TestContext.BuildInfo.ProjectName); if (!Directory.Exists(ProjectPath)) { Log.Warning(string.Format("Directory does not exist at {0}! Returned ConfigHierarchy will not contain any config values. Make sure to sync the config directory for the project you are trying to run.", ProjectPath)); } return(ConfigCache.ReadHierarchy(ConfigType, new DirectoryReference(ProjectPath), TestContext.GetRoleContext(TargetRole).Platform)); }
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."); }
/** * 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 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 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")); }
public void SetupBuildVersion() { string BUILD_VERSION = WARRIORB_BUILD_VERSION; string BRANCH = "None"; string COMMIT = "None"; string DEMO = WARRIORB_DEMO ? "-DEMO" : ""; // Read build version GetCurrentBranchAndCommit(ref BRANCH, ref COMMIT); Console.WriteLine(""); PrintBlue(String.Format("BUILD_VERSION = {0}, BRANCH = {1}, COMMIT = {2}, DEMO = {3}", BUILD_VERSION, BRANCH, COMMIT, WARRIORB_DEMO)); Console.WriteLine(""); // The current build number // NOTE: this also sets the GameAnalytics version for all platforms, so you do not need to update those values. PublicDefinitions.Add(String.Format("WARRIORB_BUILD_VERSION=\"{0}\"", BUILD_VERSION)); PublicDefinitions.Add(String.Format("WARRIORB_BUILD_BRANCH=\"{0}\"", BRANCH)); PublicDefinitions.Add(String.Format("WARRIORB_BUILD_COMMIT=\"{0}\"", COMMIT)); // Write to file so that other resources can use it string VersionFileText = @" // DO NOT MODIFY - FILE AUTOMATICALLY GENERATED in SOrb.Build.cs - DO NOT MODIFY #define WARRIORB_BUILD_VERSION {0} #define WARRIORB_BUILD_BRANCH {1} #define WARRIORB_BUILD_COMMIT {2} #define WARRIORB_BUILD_ALL {0}-{1}-{2}{3} // DO NOT MODIFY - FILE AUTOMATICALLY GENERATED in SOrb.Build.cs - DO NOT MODIFY "; string VersionFileTextFormat = String.Format(VersionFileText, BUILD_VERSION, BRANCH, COMMIT, DEMO); File.WriteAllText(WarriorbVersionFilePath, VersionFileTextFormat); // Do replacements in GeneralProjectSettings ConfigHierarchy ConfigGameHierarchy = ConfigCache.ReadHierarchy(ConfigHierarchyType.Game, new DirectoryReference(ProjectRootPath), Target.Platform); Dictionary <string, string> GeneralProjectSettingsReplacements = new Dictionary <string, string>(); // ProjectVersion { string CurrentProjectVersion; ConfigGameHierarchy.GetString("/Script/EngineSettings.GeneralProjectSettings", "ProjectVersion", out CurrentProjectVersion); string FormatString = "ProjectVersion={0}"; GeneralProjectSettingsReplacements.Add(String.Format(FormatString, CurrentProjectVersion), String.Format(FormatString, WARRIORB_BUILD_VERSION)); } // ProjectName { string CurrentProjectName; ConfigGameHierarchy.GetString("/Script/EngineSettings.GeneralProjectSettings", "ProjectName", out CurrentProjectName); string FormatString = "ProjectName={0}"; string ReplacementString = WARRIORB_DEMO ? ProjectNameDemo : ProjectName; GeneralProjectSettingsReplacements.Add(String.Format(FormatString, CurrentProjectName), String.Format(FormatString, ReplacementString)); } // ProjectDisplayedTitle { string CurrentProjectDisplayedTitle; ConfigGameHierarchy.GetString("/Script/EngineSettings.GeneralProjectSettings", "ProjectDisplayedTitle", out CurrentProjectDisplayedTitle); string FormatString = "ProjectDisplayedTitle={0}"; string ReplacementString = WARRIORB_DEMO ? ProjectDisplayedTitleDemo : ProjectDisplayedTitle; GeneralProjectSettingsReplacements.Add(String.Format(FormatString, CurrentProjectDisplayedTitle), String.Format(FormatString, ReplacementString)); } PatchFile(DefaultGameConfigPath, GeneralProjectSettingsReplacements); }
/// <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, bool AssetNativizationRequested) { var Properties = new ProjectProperties(); Properties.RawProjectPath = RawProjectPath; // detect if the project is content only, but has non-default build settings List <string> ExtraSearchPaths = null; if (RawProjectPath != null) { string TempTargetDir = CommandUtils.CombinePaths(Path.GetDirectoryName(RawProjectPath.FullName), "Intermediate", "Source"); if (RequiresTempTarget(RawProjectPath, ClientTargetPlatforms, 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 Enum.GetValues(typeof(UnrealTargetPlatform))) { if (TargetPlatformType != UnrealTargetPlatform.Unknown) { var Config = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, RawProjectPath.Directory, TargetPlatformType); Properties.EngineConfigs.Add(TargetPlatformType, Config); } } foreach (UnrealTargetPlatform TargetPlatformType in Enum.GetValues(typeof(UnrealTargetPlatform))) { if (TargetPlatformType != UnrealTargetPlatform.Unknown) { var Config = ConfigCache.ReadHierarchy(ConfigHierarchyType.Game, RawProjectPath.Directory, TargetPlatformType); Properties.GameConfigs.Add(TargetPlatformType, Config); } } } return(Properties); }
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")); }
public AppCenter(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; PublicDependencyModuleNames.AddRange( new string[] { "Core", // ... add other public dependencies that you statically link with here ... } ); PrivateDependencyModuleNames.AddRange( new string[] { "CoreUObject", "Engine", "Slate", "SlateCore", // ... add private dependencies that you statically link with here ... } ); // Setup platform include paths if (Target.Platform == UnrealTargetPlatform.Android) { PrivateIncludePaths.Add("AppCenter/Private/Android"); } else if (Target.Platform == UnrealTargetPlatform.IOS) { PrivateIncludePaths.Add("AppCenter/Private/IOS"); } // Configure build defines bool bAppCenterEnabled = false; bool bEnableAnalytics = false; bool bEnableCrashes = false; bool bEnableDistribute = false; bool bEnablePush = false; string AppSecretAndroid = ""; string AppSecretIOS = ""; // Read from config ConfigHierarchy Ini = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, Target.ProjectFile.Directory, Target.Platform); string SettingsSection = "/Script/AppCenter.AppCenterSettings"; Ini.GetBool(SettingsSection, "bEnableAnalytics", out bEnableAnalytics); Ini.GetBool(SettingsSection, "bEnableCrashes", out bEnableCrashes); Ini.GetBool(SettingsSection, "bEnableDistribute", out bEnableDistribute); Ini.GetBool(SettingsSection, "bEnablePush", out bEnablePush); Ini.GetString(SettingsSection, "AppSecretAndroid", out AppSecretAndroid); Ini.GetString(SettingsSection, "AppSecretIOS", out AppSecretIOS); bool bAnyModuleEnabled = (bEnableAnalytics | bEnableCrashes | bEnableDistribute | bEnablePush); if (bAnyModuleEnabled) { if (Target.Platform == UnrealTargetPlatform.Android && AppSecretAndroid != "") { bAppCenterEnabled = true; PublicDependencyModuleNames.AddRange(new string[] { "Launch" }); string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath); AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(PluginPath, "AppCenter_UPL_Android.xml")); if (bEnableCrashes) { /** * Application.mk * * APP_STL := gnustl_static * APP_ABI := armeabi-v7a, arm64-v8a * APP_CXXFLAGS := -std=c++11 -D__STDC_LIMIT_MACROS * APP_PLATFORM := android-19 */ string ThirdPartyPath = Path.Combine(ModuleDirectory, "..", "ThirdParty"); PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, "Breakpad", "src")); PublicLibraryPaths.Add(Path.Combine(ThirdPartyPath, "Breakpad", "lib", "armeabi-v7a")); PublicLibraryPaths.Add(Path.Combine(ThirdPartyPath, "Breakpad", "lib", "arm64-v8a")); PublicAdditionalLibraries.Add("breakpad_client"); } } else if (Target.Platform == UnrealTargetPlatform.IOS && AppSecretIOS != "") { bAppCenterEnabled = true; string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath); AdditionalPropertiesForReceipt.Add("IOSPlugin", Path.Combine(PluginPath, "AppCenter_UPL_IOS.xml")); // The AppCenter.framework is required to start the SDK. If it is not added to the project, // the other modules won't work and your app won't compile. PublicAdditionalFrameworks.Add( new Framework( "AppCenter", "../../ThirdParty/AppCenter-SDK-Apple/iOS/AppCenter.embeddedframework.zip" ) ); if (bEnableAnalytics) { PublicAdditionalFrameworks.Add( new Framework( "AppCenterAnalytics", "../../ThirdParty/AppCenter-SDK-Apple/iOS/AppCenterAnalytics.embeddedframework.zip" ) ); } if (bEnableCrashes) { PublicAdditionalFrameworks.Add( new Framework( "AppCenterCrashes", "../../ThirdParty/AppCenter-SDK-Apple/iOS/AppCenterCrashes.embeddedframework.zip" ) ); } if (bEnableDistribute) { PublicAdditionalFrameworks.Add( new Framework( "AppCenterDistribute", "../../ThirdParty/AppCenter-SDK-Apple/iOS/AppCenterDistribute.embeddedframework.zip", "AppCenterDistributeResources.bundle" ) ); } if (bEnablePush) { PublicAdditionalFrameworks.Add( new Framework( "AppCenterPush", "../../ThirdParty/AppCenter-SDK-Apple/iOS/AppCenterPush.embeddedframework.zip" ) ); } } } // Setup defines based on reality if (bAppCenterEnabled) { PublicDefinitions.Add("WITH_APPCENTER=" + (bAnyModuleEnabled ? "1" : "0")); PublicDefinitions.Add("WITH_APPCENTER_ANALYTICS=" + (bEnableAnalytics ? "1" : "0")); PublicDefinitions.Add("WITH_APPCENTER_CRASHES=" + (bEnableCrashes ? "1" : "0")); PublicDefinitions.Add("WITH_APPCENTER_DISTIBUTE=" + (bEnableDistribute ? "1" : "0")); PublicDefinitions.Add("WITH_APPCENTER_PUSH=" + (bEnablePush ? "1" : "0")); } else { PublicDefinitions.Add("WITH_APPCENTER=0"); PublicDefinitions.Add("WITH_APPCENTER_ANALYTICS=0"); PublicDefinitions.Add("WITH_APPCENTER_CRASHES=0"); PublicDefinitions.Add("WITH_APPCENTER_DISTIBUTE=0"); PublicDefinitions.Add("WITH_APPCENTER_PUSH=0"); } }
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; } } }
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); }
private static ConfigHierarchy GetIni(DirectoryReference ProjectDirectory) { return(ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, ProjectDirectory, UnrealTargetPlatform.IOS)); //return ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromFile(ProjectFile), UnrealTargetPlatform.IOS); }
public List <ISharedCookedBuild> FindBestBuilds() { // Attempt manifest searching first ConfigHierarchy Hierarchy = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromFile(ProjectFile), UnrealTargetPlatform.Win64); IEnumerable <string> RawSharedCookedSources = null; Hierarchy.TryGetValues("SharedCookedBuildSettings", "SharedCookedSources", out RawSharedCookedSources); if (RawSharedCookedSources == null) { throw new AutomationException("Unable to locate shared cooked builds. SharedCookedSources not set in Engine.ini [SharedCookedBuildSettings]"); } List <Dictionary <string, string> > ParsedSharedCookSources = new List <Dictionary <string, string> >(); foreach (string RawConfig in RawSharedCookedSources) { Dictionary <string, string> ParsedSource = null; if (ConfigHierarchy.TryParse(RawConfig, out ParsedSource)) { ParsedSharedCookSources.Add(ParsedSource); } } List <ISharedCookedBuild> CandidateBuilds = new List <ISharedCookedBuild>(); // If existing sync is present, stick to it. Read version out of sync file foreach (string Platform in TargetPlatforms) { FileReference SyncedBuildFile = new FileReference(CommandUtils.CombinePaths(InstallPath.FullName, Platform, SyncedBuildFileName)); if (FileReference.Exists(SyncedBuildFile)) { string[] SyncedBuildInfo = FileReference.ReadAllLines(SyncedBuildFile); int SyncedCL = int.Parse(SyncedBuildInfo[0]); if (IsValidCL(SyncedCL, BuildType, LocalSync)) { CandidateBuilds.Add(new ExistingSharedCookedBuild() { CL = SyncedCL, Platform = Platform }); } } } foreach (Dictionary <string, string> Source in ParsedSharedCookSources) { SharedCookSource SourceType = (SharedCookSource)Enum.Parse(typeof(SharedCookSource), Source["Type"], true); foreach (string Platform in TargetPlatforms) { if (SourceType == SharedCookSource.Manifest) { CandidateBuilds.AddRange(FindValidManifestBuilds(Source["Path"], Platform)); } else if (SourceType == SharedCookSource.LooseFiles) { CandidateBuilds.AddRange(FindValidLooseBuilds(Source["Path"], Platform)); } } } // Strip all failed searches CandidateBuilds.RemoveAll(x => x == null); // Make sure we have a matching CL for all target platforms, regardless of source List <int> OrderedDistinctCLs = CandidateBuilds.Select(x => x.CL).Distinct().OrderByDescending(i => i).ToList(); int BestCL = -1; foreach (int CL in OrderedDistinctCLs) { // Ensure we have a platform for each HashSet <string> CLPlatforms = new HashSet <string>(CandidateBuilds.Where(x => x.CL == CL).Select(x => x.Platform).ToList()); if (CLPlatforms.SetEquals(TargetPlatforms)) { BestCL = CL; break; } } if (BestCL < 0) { CommandUtils.LogError("Could not locate valid shared cooked build for all target platforms"); CommandUtils.LogError("Current CL: {0}, Current Code CL: {1}", LocalSync.Changelist, LocalSync.CompatibleChangelist); } return(CandidateBuilds.Where(x => x.CL == BestCL).ToList()); }
public NetPhysSync(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; int BufferSize = 20; Log.TraceInformation("######## Target Directory : " + Target.ProjectFile.Directory.FullName); ConfigHierarchy EngineConfig = ConfigCache.ReadHierarchy ( ConfigHierarchyType.Engine, DirectoryReference.FromFile(Target.ProjectFile), Target.Platform ); ConfigHierarchy GameConfig = ConfigCache.ReadHierarchy ( ConfigHierarchyType.Game, DirectoryReference.FromFile(Target.ProjectFile), Target.Platform ); if (EngineConfig != null) { float PhysSubstepDeltaTime; float SupportRTTInMS; int JitterWaitPhysTick; if (EngineConfig.TryGetValue("/Script/Engine.PhysicsSettings", "MaxSubstepDeltaTime", out PhysSubstepDeltaTime) && GameConfig.TryGetValue("/Script/NetPhysSync.NPSNetSetting", "SupportRTTInMS", out SupportRTTInMS) && GameConfig.TryGetValue("/Script/NetPhysSync.NPSNetSetting", "JitterWaitPhysTick", out JitterWaitPhysTick)) { float BufferSizeFloat = (0.001f * SupportRTTInMS) / PhysSubstepDeltaTime; BufferSize = (int)Math.Ceiling(BufferSizeFloat); if (2 * BufferSize > BufferSize + JitterWaitPhysTick) { BufferSize = 2 * BufferSize; } else { BufferSize = 2 * BufferSize + JitterWaitPhysTick; } Log.TraceInformation("######## NPS_BUFFER_SIZE=" + BufferSize); } else { Log.TraceInformation("######## Cannot find value from config file. Set NPS_BUFFER_SIZE to default 20"); } } PublicDefinitions.Add("NPS_BUFFER_SIZE=" + BufferSize); PublicDefinitions.Add("NPS_LOG_SYNC_AUTO_PROXY=0"); PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OnlineSubSystem", "OnlineSubsystemUtils", "PhysX", "APEX" }); // Uncomment if you are using Slate UI PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore", "UMG" }); // Uncomment if you are using online features // PrivateDependencyModuleNames.Add("OnlineSubsystem"); // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true }
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; } } }
static void CopySharedCookedBuildForTarget(ProjectParams Params, TargetPlatformDescriptor TargetPlatform, string CookPlatform) { string ProjectPath = Params.RawProjectPath.FullName; var LocalPath = CombinePaths(GetDirectoryName(ProjectPath), "Saved", "SharedIterativeBuild", CookPlatform); // get network location ConfigHierarchy Hierarchy = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromFile(Params.RawProjectPath), TargetPlatform.Type); string CookedBuildPath; if (Hierarchy.GetString("SharedCookedBuildSettings", "SharedCookedBuildPath", out CookedBuildPath) == false) { Log("Unable to copy shared cooked build: SharedCookedBuildPath not set in Engine.ini SharedCookedBuildSettings"); return; } string BuildRoot = P4Enabled ? P4Env.BuildRootP4.Replace("/", "+") : ""; int RecentCL = P4Enabled ? P4Env.Changelist : 0; BuildVersion Version; if (BuildVersion.TryRead(out Version)) { RecentCL = Version.Changelist; BuildRoot = Version.BranchName; } // check to see if we have already synced this build ;) var SyncedBuildFile = CombinePaths(LocalPath, "SyncedBuild.txt"); string BuildCL = "Invalid"; if (File.Exists(SyncedBuildFile)) { BuildCL = File.ReadAllText(SyncedBuildFile); } if (RecentCL == 0 && CookedBuildPath.Contains("[CL]")) { Log("Unable to copy shared cooked build: Unable to determine CL number from P4 or UGS, and is required by SharedCookedBuildPath"); return; } if (RecentCL == 0 && CookedBuildPath.Contains("[BRANCHNAME]")) { Log("Unable to copy shared cooked build: Unable to determine BRANCHNAME number from P4 or UGS, and is required by SharedCookedBuildPath"); return; } CookedBuildPath = CookedBuildPath.Replace("[CL]", RecentCL.ToString()); CookedBuildPath = CookedBuildPath.Replace("[BRANCHNAME]", BuildRoot); CookedBuildPath = CookedBuildPath.Replace("[PLATFORM]", CookPlatform); if (Directory.Exists(CookedBuildPath) == false) { Log("Unable to copy shared cooked build: Unable to find shared build at location {0} check SharedCookedBuildPath in Engine.ini SharedCookedBuildSettings is correct", CookedBuildPath); return; } Log("Attempting download of latest shared build CL {0} from location {1}", RecentCL, CookedBuildPath); if (BuildCL == RecentCL.ToString()) { Log("Already downloaded latest shared build at CL {0}", RecentCL); return; } // delete all the stuff Log("Deleting previous shared build because it was out of date"); CommandUtils.DeleteDirectory(LocalPath); Directory.CreateDirectory(LocalPath); // find all the files in the staged directory string CookedBuildStagedDirectory = Path.GetFullPath(Path.Combine(CookedBuildPath, "Staged")); string LocalBuildStagedDirectory = Path.GetFullPath(Path.Combine(LocalPath, "Staged")); if (Directory.Exists(CookedBuildStagedDirectory)) { foreach (string FileName in Directory.EnumerateFiles(CookedBuildStagedDirectory, "*.*", SearchOption.AllDirectories)) { string SourceFileName = Path.GetFullPath(FileName); string DestFileName = SourceFileName.Replace(CookedBuildStagedDirectory, LocalBuildStagedDirectory); Directory.CreateDirectory(Path.GetDirectoryName(DestFileName)); File.Copy(SourceFileName, DestFileName); } } string CookedBuildCookedDirectory = Path.Combine(CookedBuildPath, "Cooked"); CookedBuildCookedDirectory = Path.GetFullPath(CookedBuildCookedDirectory); string LocalBuildCookedDirectory = Path.Combine(LocalPath, "Cooked"); LocalBuildCookedDirectory = Path.GetFullPath(LocalBuildCookedDirectory); if (Directory.Exists(CookedBuildCookedDirectory)) { foreach (string FileName in Directory.EnumerateFiles(CookedBuildCookedDirectory, "*.*", SearchOption.AllDirectories)) { string SourceFileName = Path.GetFullPath(FileName); string DestFileName = SourceFileName.Replace(CookedBuildCookedDirectory, LocalBuildCookedDirectory); Directory.CreateDirectory(Path.GetDirectoryName(DestFileName)); File.Copy(SourceFileName, DestFileName); } } File.WriteAllText(SyncedBuildFile, RecentCL.ToString()); return; }
public static void LoadBundleConfig <TPlatformBundleSettings>(DirectoryReference ProjectDir, UnrealTargetPlatform Platform, out List <TPlatformBundleSettings> Bundles, Action <TPlatformBundleSettings, ConfigHierarchy, string> GetPlatformSettings) where TPlatformBundleSettings : BundleSettings, new() { Bundles = 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; } } { 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>(); } GetPlatformSettings(Bundle, BundleConfig, BundleDefinitionPrefix + Bundle.Name); Bundles.Add(Bundle); } // Use OrderBy and not Sort because OrderBy is stable Bundles = Bundles.OrderBy(Bundle => Bundle.Order).ToList(); }
public PsIronSource(ReadOnlyTargetRules Target) : base(Target) { bool bIronSourceEnable = false; ConfigHierarchy EngineConfig = ConfigCache.ReadHierarchy(ConfigHierarchyType.Engine, DirectoryReference.FromFile(Target.ProjectFile), Target.Platform); EngineConfig.TryGetValue("/Script/PsIronSource.PsIronSourceSettings", "bIronSourceEnable", out bIronSourceEnable); PublicDefinitions.Add("WITH_IRONSOURCE=" + (bIronSourceEnable ? "1" : "0")); PrivateIncludePaths.AddRange( new string[] { "PsIronSource/Private", }); PublicDependencyModuleNames.AddRange( new string[] { "Core", "CoreUObject", "Engine", }); PrivateIncludePathModuleNames.AddRange( new string[] { "Settings", } ); if (bIronSourceEnable) { if (Target.Platform == UnrealTargetPlatform.IOS) { string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath); AdditionalPropertiesForReceipt.Add("IOSPlugin", Path.Combine(PluginPath, "PsIronSource_UPL_IOS.xml")); PublicAdditionalFrameworks.Add( new Framework( "IronSource", "../../ThirdParty/iOS/IronSource.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "ISFacebookAdapter", "../../ThirdParty/iOS/ISFacebookAdapter.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "UnityAds", "../../ThirdParty/iOS/UnityAds.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "ISUnityAdsAdapter", "../../ThirdParty/iOS/ISUnityAdsAdapter.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "ISAdMobAdapter", "../../ThirdParty/iOS/ISAdMobAdapter.embeddedframework.zip" ) ); // Dependence for ISAdMobAdapter PublicAdditionalFrameworks.Add( new Framework( "GoogleAppMeasurement", "../../ThirdParty/iOS/GoogleAppMeasurement_is.embeddedframework.zip" ) ); // Dependence for ISAdMobAdapter PublicAdditionalFrameworks.Add( new Framework( "GoogleMobileAds", "../../ThirdParty/iOS/GoogleMobileAds.embeddedframework.zip" ) ); // Dependence for ISAdMobAdapter PublicAdditionalFrameworks.Add( new Framework( "GoogleUtilities", "../../ThirdParty/iOS/GoogleUtilities_is.embeddedframework.zip" ) ); // Dependence for ISAdMobAdapter PublicAdditionalFrameworks.Add( new Framework( "nanopb", "../../ThirdParty/iOS/nanopb_is.embeddedframework.zip" ) ); // Dependence for ISAdMobAdapter PublicAdditionalFrameworks.Add( new Framework( "PromisesObjC", "../../ThirdParty/iOS/PromisesObjC_is.embeddedframework.zip" ) ); // Dependence for ISAdMobAdapter PublicAdditionalFrameworks.Add( new Framework( "UserMessagingPlatform", "../../ThirdParty/iOS/UserMessagingPlatform.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "ISAppLovinAdapter", "../../ThirdParty/iOS/ISAppLovinAdapter.embeddedframework.zip" ) ); // Dependence for ISAppLovinAdapter PublicAdditionalFrameworks.Add( new Framework( "AppLovinSDK", "../../ThirdParty/iOS/AppLovinSDK.embeddedframework.zip", "AppLovinSDKResources.bundle" ) ); PublicAdditionalFrameworks.Add( new Framework( "VungleSDK", "../../ThirdParty/iOS/VungleSDK.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "ISVungleAdapter", "../../ThirdParty/iOS/ISVungleAdapter.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "AdColony", "../../ThirdParty/iOS/AdColony.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "ISAdColonyAdapter", "../../ThirdParty/iOS/ISAdColonyAdapter.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "Tapjoy", "../../ThirdParty/iOS/Tapjoy.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "ISTapjoyAdapter", "../../ThirdParty/iOS/ISTapjoyAdapter.embeddedframework.zip" ) ); PublicSystemLibraries.Add("xml2"); PublicSystemLibraries.Add("sqlite3"); PublicSystemLibraries.Add("resolv"); PublicAdditionalFrameworks.Add( new Framework( "Chartboost", "../../ThirdParty/iOS/Chartboost.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "ISChartboostAdapter", "../../ThirdParty/iOS/ISChartboostAdapter.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "ISMyTargetAdapter", "../../ThirdParty/iOS/ISMyTargetAdapter.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "MyTargetSDK", "../../ThirdParty/iOS/MyTargetSDK.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "ISPangleAdapter", "../../ThirdParty/iOS/ISPangleAdapter.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "BUAdSDK", "../../ThirdParty/iOS/BUAdSDK.embeddedframework.zip", "BUAdSDK.bundle" ) ); PublicAdditionalFrameworks.Add( new Framework( "BUFoundation", "../../ThirdParty/iOS/BUFoundation.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "BUCNAuxiliary", "../../ThirdParty/iOS/BUCNAuxiliary.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "BUVAAuxiliary", "../../ThirdParty/iOS/BUVAAuxiliary.embeddedframework.zip" ) ); PublicAdditionalFrameworks.Add( new Framework( "BURelyFoundation_Global", "../../ThirdParty/iOS/BURelyFoundation_Global.embeddedframework.zip" ) ); PublicSystemLibraries.Add("z"); PublicSystemLibraries.Add("bz2"); PublicSystemLibraries.Add("c++abi"); } else if (Target.Platform == UnrealTargetPlatform.Android) { string PluginPath = Utils.MakePathRelativeTo(ModuleDirectory, Target.RelativeEnginePath); AdditionalPropertiesForReceipt.Add("AndroidPlugin", Path.Combine(PluginPath, "PsIronSource_UPL_Android.xml")); } } }
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."); }
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; } } }