static void PackagePlugin(FileReference SourcePluginFile, IEnumerable <FileReference> BuildProducts, DirectoryReference TargetDir, bool bUnversioned) { DirectoryReference SourcePluginDir = SourcePluginFile.Directory; // Copy all the files to the output directory FileReference[] SourceFiles = FilterPluginFiles(SourcePluginFile, BuildProducts).ToArray(); foreach (FileReference SourceFile in SourceFiles) { FileReference TargetFile = FileReference.Combine(TargetDir, SourceFile.MakeRelativeTo(SourcePluginDir)); CommandUtils.CopyFile(SourceFile.FullName, TargetFile.FullName); CommandUtils.SetFileAttributes(TargetFile.FullName, ReadOnly: false); } // Get the output plugin filename FileReference TargetPluginFile = FileReference.Combine(TargetDir, SourcePluginFile.GetFileName()); PluginDescriptor NewDescriptor = PluginDescriptor.FromFile(TargetPluginFile); NewDescriptor.bEnabledByDefault = null; NewDescriptor.bInstalled = true; if (!bUnversioned) { BuildVersion Version; if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version)) { NewDescriptor.EngineVersion = String.Format("{0}.{1}.0", Version.MajorVersion, Version.MinorVersion); } } NewDescriptor.Save(TargetPluginFile.FullName); }
public static BuildVersion GetLocalSync() { BuildVersion P4Version = new BuildVersion(); if (CommandUtils.P4Enabled) { P4Version.BranchName = CommandUtils.P4Env.Branch.Replace("/", "+"); P4Version.Changelist = CommandUtils.P4Env.Changelist; P4Version.CompatibleChangelist = CommandUtils.P4Env.CodeChangelist; } BuildVersion UGSVersion; if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out UGSVersion)) { return(UGSVersion); } if (!CommandUtils.P4Enabled) { throw new AutomationException("Cannot determine local sync"); } return(P4Version); }
public PlayFabCommon(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public")); PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private")); PublicDependencyModuleNames.AddRange( new string[] { "Core", "CoreUObject", "Engine", "HTTP", "Json", "JsonUtilities", } ); if (Target.bBuildEditor == true) { PrivateDependencyModuleNames.AddRange(new string[] { "Settings" }); } BuildVersion Version; BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version); PublicDefinitions.Add(string.Format("ENGINE_MAJOR_VERSION={0}", Version.MajorVersion)); PublicDefinitions.Add(string.Format("ENGINE_MINOR_VERSION={0}", Version.MinorVersion)); }
private static bool CopySharedCookedBuildForTargetInternal(string CookedBuildPath, string CookPlatform, string LocalPath, bool bOnlyCopyAssetRegistry) { string BuildRoot = CommandUtils.P4Enabled ? CommandUtils.P4Env.Branch.Replace("/", "+") : ""; string RecentCL = CommandUtils.P4Enabled ? CommandUtils.P4Env.Changelist.ToString() : ""; BuildVersion Version; if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version)) { RecentCL = Version.Changelist.ToString(); BuildRoot = Version.BranchName; } System.GC.Collect(); // check to see if we have already synced this build ;) var SyncedBuildFile = CommandUtils.CombinePaths(LocalPath, "SyncedBuild.txt"); string BuildCL = "Invalid"; if (File.Exists(SyncedBuildFile)) { BuildCL = File.ReadAllText(SyncedBuildFile); } if (RecentCL == "" && CookedBuildPath.Contains("[CL]")) { CommandUtils.Log("Unable to copy shared cooked build: Unable to determine CL number from P4 or UGS, and is required by SharedCookedBuildPath"); return(false); } if (RecentCL == "" && CookedBuildPath.Contains("[BRANCHNAME]")) { CommandUtils.Log("Unable to copy shared cooked build: Unable to determine BRANCHNAME number from P4 or UGS, and is required by SharedCookedBuildPath"); return(false); } CookedBuildPath = CookedBuildPath.Replace("[CL]", RecentCL.ToString()); CookedBuildPath = CookedBuildPath.Replace("[BRANCHNAME]", BuildRoot); CookedBuildPath = CookedBuildPath.Replace("[PLATFORM]", CookPlatform); if (Directory.Exists(CookedBuildPath) == false) { CommandUtils.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(false); } CommandUtils.Log("Attempting download of latest shared build CL {0} from location {1}", RecentCL, CookedBuildPath); if (BuildCL == RecentCL.ToString()) { CommandUtils.Log("Already downloaded latest shared build at CL {0}", RecentCL); return(false); } if (bOnlyCopyAssetRegistry) { RecentCL += "RegistryOnly"; } if (BuildCL == RecentCL) { CommandUtils.Log("Already downloaded latest shared build at CL {0}", RecentCL); return(false); } // delete all the stuff CommandUtils.Log("Deleting previous shared build because it was out of date"); CommandUtils.DeleteDirectory(LocalPath); Directory.CreateDirectory(LocalPath); string CookedBuildMetadataDirectory = Path.Combine(CookedBuildPath, "Metadata"); CookedBuildMetadataDirectory = Path.GetFullPath(CookedBuildMetadataDirectory); string LocalBuildMetadataDirectory = Path.Combine(LocalPath, "Metadata"); LocalBuildMetadataDirectory = Path.GetFullPath(LocalBuildMetadataDirectory); if (Directory.Exists(CookedBuildMetadataDirectory)) { foreach (string FileName in Directory.EnumerateFiles(CookedBuildMetadataDirectory, "*.*", SearchOption.AllDirectories)) { string SourceFileName = Path.GetFullPath(FileName); string DestFileName = SourceFileName.Replace(CookedBuildMetadataDirectory, LocalBuildMetadataDirectory); Directory.CreateDirectory(Path.GetDirectoryName(DestFileName)); File.Copy(SourceFileName, DestFileName); } } if (CopySharedCookedBuildTask != null) { WaitForCopy(); } if (bOnlyCopyAssetRegistry == false) { CopySharedCookedBuildTask = Task.Run(() => { // 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); } } File.WriteAllText(SyncedBuildFile, RecentCL.ToString()); } ); } else { File.WriteAllText(SyncedBuildFile, RecentCL.ToString()); } return(true); }
virtual protected bool ResolveBuildReference(string InBuildReference, Func <string, string> ResolutionDelegate, out IEnumerable <string> OutBuildPaths, out string OutBuildName) { OutBuildName = null; OutBuildPaths = null; if (string.IsNullOrEmpty(InBuildReference)) { return(false); } if (InBuildReference.Equals("AutoP4", StringComparison.InvariantCultureIgnoreCase)) { if (!CommandUtils.P4Enabled) { throw new AutomationException("-Build=AutoP4 requires -P4"); } if (CommandUtils.P4Env.Changelist < 1000) { throw new AutomationException("-Build=AutoP4 requires a CL from P4 and we have {0}", CommandUtils.P4Env.Changelist); } string BuildRoot = CommandUtils.CombinePaths(CommandUtils.RootBuildStorageDirectory()); string CachePath = InternalUtils.GetEnvironmentVariable("UE-BuildCachePath", ""); string SrcBuildPath = CommandUtils.CombinePaths(BuildRoot, ProjectName); string SrcBuildPath2 = CommandUtils.CombinePaths(BuildRoot, ProjectName.Replace("Game", "").Replace("game", "")); string SrcBuildPath_Cache = CommandUtils.CombinePaths(CachePath, ProjectName); string SrcBuildPath2_Cache = CommandUtils.CombinePaths(CachePath, ProjectName.Replace("Game", "").Replace("game", "")); if (!InternalUtils.SafeDirectoryExists(SrcBuildPath)) { if (!InternalUtils.SafeDirectoryExists(SrcBuildPath2)) { throw new AutomationException("-Build=AutoP4: Neither {0} nor {1} exists.", SrcBuildPath, SrcBuildPath2); } SrcBuildPath = SrcBuildPath2; SrcBuildPath_Cache = SrcBuildPath2_Cache; } string SrcCLPath = CommandUtils.CombinePaths(SrcBuildPath, CommandUtils.EscapePath(CommandUtils.P4Env.Branch) + "-CL-" + CommandUtils.P4Env.Changelist.ToString()); string SrcCLPath_Cache = CommandUtils.CombinePaths(SrcBuildPath_Cache, CommandUtils.EscapePath(CommandUtils.P4Env.Branch) + "-CL-" + CommandUtils.P4Env.Changelist.ToString()); if (!InternalUtils.SafeDirectoryExists(SrcCLPath)) { throw new AutomationException("-Build=AutoP4: {0} does not exist.", SrcCLPath); } if (InternalUtils.SafeDirectoryExists(SrcCLPath_Cache)) { InBuildReference = SrcCLPath_Cache; } else { InBuildReference = SrcCLPath; } Log.Verbose("Using AutoP4 path {0}", InBuildReference); } // BuildParam could be a path, a name that we should resolve to a path, Staged, or Editor DirectoryInfo BuildDir = new DirectoryInfo(InBuildReference); if (BuildDir.Exists) { // Easy option first - is this a full path? OutBuildName = BuildDir.Name; OutBuildPaths = new string[] { BuildDir.FullName }; } else if (BuildDir.Name.Equals("local", StringComparison.OrdinalIgnoreCase) || BuildDir.Name.Equals("staged", StringComparison.OrdinalIgnoreCase)) { // First special case - "Staged" means use whats locally staged OutBuildName = "Local"; string StagedPath = Path.Combine(ProjectPath.Directory.FullName, "Saved", "StagedBuilds"); if (Directory.Exists(StagedPath) == false) { Log.Error("BuildReference was Staged but staged directory {0} not found", StagedPath); return(false); } // include binaries path for packaged builds if it exists string BinariesPath = Path.Combine(ProjectPath.Directory.FullName, "Binaries"); OutBuildPaths = Directory.Exists(BinariesPath) ? new string[] { StagedPath, BinariesPath } : new string[] { StagedPath }; } else if (BuildDir.Name.Equals("editor", StringComparison.OrdinalIgnoreCase)) { // Second special case - "Editor" means run using the editor, no path needed OutBuildName = "Editor"; OutBuildPaths = new string[] { Environment.CurrentDirectory }; } else { // todo - make this more generic if (BuildDir.Name.Equals("usesyncedbuild", StringComparison.OrdinalIgnoreCase)) { BuildVersion Version; if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version)) { InBuildReference = Version.BranchName + "-CL-" + Version.Changelist.ToString(); } } // See if it's in the passed locations if (ResolutionDelegate != null) { string FullPath = ResolutionDelegate(InBuildReference); if (string.IsNullOrEmpty(FullPath) == false) { DirectoryInfo Di = new DirectoryInfo(FullPath); if (Di.Exists == false) { throw new AutomationException("Resolution delegate returned non existent path"); } OutBuildName = Di.Name; OutBuildPaths = new string[] { Di.FullName }; } } } if (string.IsNullOrEmpty(OutBuildName) || (OutBuildPaths == null || OutBuildPaths.Count() == 0)) { Log.Error("Unable to resolve build argument '{0}'", InBuildReference); return(false); } return(true); }
public UnrealEnginePython(TargetInfo Target) #endif { PublicIncludePaths.AddRange( new string[] { "UnrealEnginePython/Public", // ... add public include paths required here ... } ); PrivateIncludePaths.AddRange( new string[] { "UnrealEnginePython/Private", PythonHome, // ... add other private include paths required here ... } ); PublicDependencyModuleNames.AddRange( new string[] { "Core", "Sockets", "Networking", "Projects" // ... add other public dependencies that you statically link with here ... } ); PrivateDependencyModuleNames.AddRange( new string[] { "CoreUObject", "Engine", "InputCore", "Slate", "SlateCore", "MovieScene", "LevelSequence", "HTTP", "UMG", "AppFramework", "RHI", "Voice", "RenderCore", "MovieSceneCapture", "Landscape", "Foliage", // ... add private dependencies that you statically link with here ... } ); #if WITH_FORWARDED_MODULE_RULES_CTOR BuildVersion Version; if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version)) { if (Version.MinorVersion >= 18) { PrivateDependencyModuleNames.Add("ApplicationCore"); } } #endif DynamicallyLoadedModuleNames.AddRange( new string[] { // ... add any modules that your module loads dynamically here ... } ); #if WITH_FORWARDED_MODULE_RULES_CTOR if (Target.bBuildEditor) #else if (UEBuildConfiguration.bBuildEditor) #endif { PrivateDependencyModuleNames.AddRange(new string[] { "UnrealEd", "LevelEditor", "BlueprintGraph", "Projects", "Sequencer", "SequencerWidgets", "AssetTools", "LevelSequenceEditor", "MovieSceneTools", "MovieSceneTracks", "CinematicCamera", "EditorStyle", "GraphEditor", "UMGEditor", "AIGraph", "RawMesh", "DesktopWidgets", "EditorWidgets", "FBX", "Persona", "PropertyEditor", "LandscapeEditor", "MaterialEditor" }); } if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32)) { if (UseThirdPartyPython) { PythonHome = ThirdPartyPythonHome; System.Console.WriteLine("Using Embedded Python at: " + PythonHome); PublicIncludePaths.Add(PythonHome); string libPath = Path.Combine(PythonHome, "Lib", string.Format("{0}.lib", PythonType.ToLower())); System.Console.WriteLine("full lib path: " + libPath); PublicLibraryPaths.Add(Path.GetDirectoryName(libPath)); PublicAdditionalLibraries.Add(libPath); string dllPath = Path.Combine(BinariesPath, "Win64", string.Format("{0}.dll", PythonType.ToLower())); RuntimeDependencies.Add(new RuntimeDependency(dllPath)); } else if (PythonHome == "") { PythonHome = DiscoverPythonPath(windowsKnownPaths); if (PythonHome == "") { throw new System.Exception("Unable to find Python installation"); } System.Console.WriteLine("Using Python at: " + PythonHome); PublicIncludePaths.Add(PythonHome); string libPath = GetWindowsPythonLibFile(PythonHome); PublicLibraryPaths.Add(Path.GetDirectoryName(libPath)); PublicAdditionalLibraries.Add(libPath); } } //other platforms else { if (PythonHome == "") { PythonHome = DiscoverPythonPath(macKnownPaths); if (PythonHome == "") { throw new System.Exception("Unable to find Python installation"); } System.Console.WriteLine("Using Python at: " + PythonHome); PublicIncludePaths.Add(PythonHome); PublicAdditionalLibraries.Add(Path.Combine(PythonHome, "Lib", string.Format("{0}.lib", PythonType))); } else if (Target.Platform == UnrealTargetPlatform.Mac) { string includesPath = DiscoverLinuxPythonIncludesPath(); if (includesPath == null) { throw new System.Exception("Unable to find Python includes, please add a search path to linuxKnownIncludesPaths"); } string libsPath = DiscoverLinuxPythonLibsPath(); if (libsPath == null) { throw new System.Exception("Unable to find Python libs, please add a search path to linuxKnownLibsPaths"); } PublicIncludePaths.Add(includesPath); PublicAdditionalLibraries.Add(libsPath); } else if (Target.Platform == UnrealTargetPlatform.Linux) { string[] items = PythonHome.Split(';'); PublicIncludePaths.Add(items[0]); PublicAdditionalLibraries.Add(items[1]); } } /*string enableThreads = System.Environment.GetEnvironmentVariable("UEP_ENABLE_THREADS"); * if (!string.IsNullOrEmpty(enableThreads)) * { * Definitions.Add("UEPY_THREADING"); * System.Console.WriteLine("*** Enabled Python Threads support ***"); * }*/ }
public HotPatcherEditor(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; PublicIncludePaths.AddRange( new string[] { // ... add public include paths required here ... } ); PrivateIncludePaths.AddRange( new string[] { // ... add other private include paths required here ... } ); PublicDependencyModuleNames.AddRange( new string[] { "UnrealEd", "UMG", "UMGEditor", "Core", "Json", "ContentBrowser", "SandboxFile", "JsonUtilities", "TargetPlatform", "PropertyEditor", "DesktopPlatform", "Projects", "Settings", "HTTP", "RHI", "EngineSettings", "AssetRegistry", "PakFileUtilities", "HotPatcherRuntime", "BinariesPatchFeature" // ... add other public dependencies that you statically link with here ... } ); // only in UE5 if (Target.Version.MajorVersion > 4) { PublicDependencyModuleNames.AddRange(new string[] { "DeveloperToolSettings" }); } if (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 23) { PublicDependencyModuleNames.Add("ToolMenus"); } System.Func <string, bool, bool> AddPublicDefinitions = (string MacroName, bool bEnable) => { PublicDefinitions.Add(string.Format("{0}={1}", MacroName, bEnable ? 1 : 0)); return(true); }; AddPublicDefinitions("GENERATE_ASSET_REGISTRY_DATA", false); bool bIOStoreSupport = Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 25; if (bIOStoreSupport) { PublicDependencyModuleNames.AddRange(new string[] { "IoStoreUtilities" }); } AddPublicDefinitions("WITH_IO_STORE_SUPPORT", bIOStoreSupport); PrivateDependencyModuleNames.AddRange( new string[] { "Core", "UnrealEd", "Projects", "DesktopPlatform", "InputCore", "EditorStyle", "LevelEditor", "CoreUObject", "Engine", "Slate", "SlateCore", "RenderCore" // ... add private dependencies that you statically link with here ... } ); switch (Target.Configuration) { case UnrealTargetConfiguration.Debug: { PublicDefinitions.Add("WITH_HOTPATCHER_DEBUG"); break; } case UnrealTargetConfiguration.DebugGame: { PublicDefinitions.Add("WITH_HOTPATCHER_DEBUGGAME"); break; } case UnrealTargetConfiguration.Development: { PublicDefinitions.Add("WITH_HOTPATCHER_DEVELOPMENT"); break; } } ; PublicDefinitions.AddRange(new string[] { "ENABLE_COOK_ENGINE_MAP=0", "ENABLE_COOK_PLUGIN_MAP=0" }); DynamicallyLoadedModuleNames.AddRange( new string[] { // ... add any modules that your module loads dynamically here ... } ); if (Target.Version.MajorVersion < 5 && Target.Version.MinorVersion <= 21) { bUseRTTI = true; } BuildVersion Version; BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version); // PackageContext AddPublicDefinitions("WITH_EDITOR_SECTION", Version.MajorVersion > 4 || Version.MinorVersion > 24); System.Console.WriteLine("MajorVersion {0} MinorVersion: {1} PatchVersion {2}", Target.Version.MajorVersion, Target.Version.MinorVersion, Target.Version.PatchVersion); bLegacyPublicIncludePaths = false; OptimizeCode = CodeOptimization.InShippingBuildsOnly; // Game feature bool bEnableGameFeature = true; if (bEnableGameFeature || (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 26)) { PublicDefinitions.AddRange(new string[] { "ENGINE_GAME_FEATURE" }); PublicDependencyModuleNames.AddRange(new string[] { // "GameFeatures", // "ModularGameplay", }); } PublicDefinitions.AddRange(new string[] { "ENABLE_UPDATER_CHECK=1", "ENABLE_MULTI_COOKER=0", "TOOL_NAME=\"HotPatcher\"", "CURRENT_VERSION_ID=74", "REMOTE_VERSION_FILE=\"https://imzlp.com/opensource/version.json\"" }); bool bEnablePackageContext = true; AddPublicDefinitions("WITH_PACKAGE_CONTEXT", (Version.MajorVersion > 4 || Version.MinorVersion > 23) && bEnablePackageContext); if (Version.MajorVersion > 4 || Version.MajorVersion > 26) { PublicDependencyModuleNames.AddRange(new string[] { "IoStoreUtilities", "UnrealEd" }); } if (Version.MajorVersion > 4 && Version.MinorVersion > 0) { PublicIncludePaths.AddRange(new List <string>() { // Path.Combine(EngineDirectory,"Source/Developer/IoStoreUtilities/Internal"), // Path.Combine(EngineDirectory,"Source/Editor/UnrealEd/Private/Cooker"), // Path.Combine(EngineDirectory,"Source/Editor/UnrealEd/Private"), // Path.Combine(EngineDirectory,"Source/Runtime/CoreUObject/Internal"), Path.Combine(ModuleDirectory, "../CookerWriterForUE5") }); } }
public UnrealEnginePython(TargetInfo Target) #endif { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; bFasterWithoutUnity = true; PublicIncludePaths.AddRange( new string[] { "UnrealEnginePython/Public", // ... add public include paths required here ... } ); PrivateIncludePaths.AddRange( new string[] { "UnrealEnginePython/Private", // ... add other private include paths required here ... } ); PublicDependencyModuleNames.AddRange( new string[] { "Core", "Sockets", "Networking" // ... add other public dependencies that you statically link with here ... } ); PrivateDependencyModuleNames.AddRange( new string[] { "CoreUObject", "Engine", "InputCore", "Slate", "SlateCore", "MovieScene", "LevelSequence", "HTTP", "UMG", "AppFramework", "RHI", "Voice", "RenderCore", "MovieSceneCapture", "Landscape", "Foliage", // ... add private dependencies that you statically link with here ... } ); #if WITH_FORWARDED_MODULE_RULES_CTOR BuildVersion Version; if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version)) { if (Version.MinorVersion >= 18) { PrivateDependencyModuleNames.Add("ApplicationCore"); } } #endif DynamicallyLoadedModuleNames.AddRange( new string[] { // ... add any modules that your module loads dynamically here ... } ); #if WITH_FORWARDED_MODULE_RULES_CTOR if (Target.bBuildEditor) #else if (UEBuildConfiguration.bBuildEditor) #endif { PrivateDependencyModuleNames.AddRange(new string[] { "UnrealEd", "LevelEditor", "BlueprintGraph", "Projects", "Sequencer", "SequencerWidgets", "AssetTools", "LevelSequenceEditor", "MovieSceneTools", "MovieSceneTracks", "CinematicCamera", "EditorStyle", "GraphEditor", "UMGEditor", "AIGraph", "RawMesh", "DesktopWidgets", "EditorWidgets", "FBX", "Persona", "PropertyEditor", "LandscapeEditor", "MaterialEditor" }); } if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32)) { if (pythonHome == "") { pythonHome = DiscoverPythonPath(windowsKnownPaths); if (pythonHome == "") { throw new System.Exception("Unable to find Python installation"); } } System.Console.WriteLine("Using Python at: " + pythonHome); PublicIncludePaths.Add(pythonHome); string libPath = GetWindowsPythonLibFile(pythonHome); PublicLibraryPaths.Add(Path.GetDirectoryName(libPath)); PublicAdditionalLibraries.Add(libPath); } else if (Target.Platform == UnrealTargetPlatform.Mac) { if (pythonHome == "") { pythonHome = DiscoverPythonPath(macKnownPaths); if (pythonHome == "") { throw new System.Exception("Unable to find Python installation"); } } System.Console.WriteLine("Using Python at: " + pythonHome); PublicIncludePaths.Add(pythonHome); string libPath = GetMacPythonLibFile(pythonHome); PublicLibraryPaths.Add(Path.GetDirectoryName(libPath)); PublicDelayLoadDLLs.Add(libPath); Definitions.Add(string.Format("UNREAL_ENGINE_PYTHON_ON_MAC")); } else if (Target.Platform == UnrealTargetPlatform.Linux) { if (pythonHome == "") { string includesPath = DiscoverLinuxPythonIncludesPath(); if (includesPath == null) { throw new System.Exception("Unable to find Python includes, please add a search path to linuxKnownIncludesPaths"); } string libsPath = DiscoverLinuxPythonLibsPath(); if (libsPath == null) { throw new System.Exception("Unable to find Python libs, please add a search path to linuxKnownLibsPaths"); } PublicIncludePaths.Add(includesPath); PublicAdditionalLibraries.Add(libsPath); } else { string[] items = pythonHome.Split(';'); PublicIncludePaths.Add(items[0]); PublicAdditionalLibraries.Add(items[1]); } Definitions.Add(string.Format("UNREAL_ENGINE_PYTHON_ON_LINUX")); } string enableThreads = System.Environment.GetEnvironmentVariable("UEP_ENABLE_THREADS"); if (!string.IsNullOrEmpty(enableThreads)) { Definitions.Add("UEPY_THREADING"); System.Console.WriteLine("*** Enabled Python Threads support ***"); } }
public Smartsuit(ReadOnlyTargetRules Target) : base(Target) { //MinFilesUsingPrecompiledHeaderOverride = 1; //bFasterWithoutUnity = true; PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public")); PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Private")); // PublicIncludePaths.AddRange( // new string[] { // "Smartsuit/Public", // "LiveLink/Public", // // ... add public include paths required here ... //} // ); // PrivateIncludePaths.AddRange( // new string[] { // "Smartsuit/Private", // "LiveLink/Private", // // ... add other private include paths required here ... //} // ); PublicDependencyModuleNames.AddRange( new string[] { //"Core", //"Core", "AnimGraph", "BlueprintGraph", "AnimGraphRuntime", "CoreUObject", "Engine", "Sockets", "Networking", "Core", "CoreUObject", "Engine", "Sockets", "Http", "Networking", "AnimGraphRuntime", "Json", "JsonUtilities", "LiveLink", "RenderCore", "InputCore"/*, "LiveLinkInterface"*/ // ... add other public dependencies that you statically link with here ... } ); PrivateDependencyModuleNames.AddRange( new string[] { //"LiveLinkEditor", "LiveLinkInterface", "LiveLinkMessageBusFramework", //"Core", //"CoreUObject", //"Engine", //"MovieScene", //"MovieSceneTracks", //"Projects", "Messaging", "LiveLink", "LiveLinkInterface", "LiveLinkMessageBusFramework", "HeadMountedDisplay", "TimeManagement", "SlateCore", "Slate" //"CoreUObject", //"Engine", //"InputCore", //"AnimGraph", //"BlueprintGraph", //"Networking", //"Sockets", //"AnimGraphRuntime", // ... add private dependencies that you statically link with here ... } ); DynamicallyLoadedModuleNames.AddRange( new string[] { // ... add any modules that your module loads dynamically here ... } ); BuildVersion version; if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out version)) #if UE_4_19_OR_LATER PublicDefinitions.Add(string.Format("BUILT_MINOR_VERSION={0}", version.MinorVersion)); #else Definitions.Add(string.Format("BUILT_MINOR_VERSION={0}", version.MinorVersion)); #endif LoadSmartsuitMagic(Target); //PublicDefinitions.Add("LZ4F_STATIC_LINKING_ONLY"); LoadLZ4(Target); }
public HotPatcherRuntime(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; PublicIncludePaths.AddRange( new string[] { Path.Combine(EngineDirectory, "Source/Runtime/Launch"), Path.Combine(ModuleDirectory, "Public"), Path.Combine(ModuleDirectory, "Public/BaseTypes") // ... add public include paths required here ... } ); PrivateIncludePaths.AddRange( new string[] { // ... add other private include paths required here ... } ); if (Target.bBuildEditor) { PublicDependencyModuleNames.Add("TargetPlatform"); } PublicDependencyModuleNames.AddRange( new string[] { "CoreUObject", "RHI", "Core", "Projects", "Json", "JsonUtilities", "PakFile", "AssetRegistry", "BinariesPatchFeature" // ... 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 ... } ); if (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 21) { PrivateDependencyModuleNames.Add("RenderCore"); } else { PrivateDependencyModuleNames.Add("ShaderCore"); } BuildVersion Version; BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version); // PackageContext System.Func <string, bool, bool> AddPublicDefinitions = (string MacroName, bool bEnable) => { PublicDefinitions.Add(string.Format("{0}={1}", MacroName, bEnable ? 1 : 0)); return(true); }; AddPublicDefinitions("WITH_EDITOR_SECTION", Version.MajorVersion > 4 || Version.MinorVersion > 24); bool bCustomAssetGUID = false; if (bCustomAssetGUID) { PublicDefinitions.Add("CUSTOM_ASSET_GUID"); } bLegacyPublicIncludePaths = false; OptimizeCode = CodeOptimization.InShippingBuildsOnly; }
public SpaceNav3D(ReadOnlyTargetRules Target) : base(Target) { // tanis - start faster compile time for small projects MinFilesUsingPrecompiledHeaderOverride = 1; bFasterWithoutUnity = true; // tanis - end PublicIncludePaths.AddRange( new string[] { "SpaceNav3D/Public" } ); PrivateIncludePaths.AddRange( new string[] { "SpaceNav3D/Private" } ); BuildVersion Version; // Have to use GetDefaultFileName() here because UE 4.18 removed the TryRead member that took one argument from UE 4.17. if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version)) { if (Version.MajorVersion == 4 && Version.MinorVersion <= 17) { PublicDependencyModuleNames.AddRange( new string[] { "Core", "CoreUObject", "Engine", "SlateCore", "Slate", "InputCore", "InputDevice" // ... add other public dependencies that you statically link with here ... } ); } else { PublicDependencyModuleNames.AddRange( new string[] { "Core", "ApplicationCore", "CoreUObject", "Engine", "SlateCore", "Slate", "InputCore", "InputDevice" // ... add other public dependencies that you statically link with here ... } ); } if (Target.Type == TargetType.Editor) { PublicDependencyModuleNames.AddRange( new string[] { "UnrealEd", } ); } } PrivateDependencyModuleNames.AddRange( new string[] { // ... add private dependencies that you statically link with here ... } ); DynamicallyLoadedModuleNames.AddRange( new string[] { // ... add any modules that your module loads dynamically here ... } ); // Load the 3DxWare SDK Load3DxWareSDK(Target); }
public HotPatcherCore(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; bLegacyPublicIncludePaths = false; OptimizeCode = CodeOptimization.InShippingBuildsOnly; if (Target.Version.MajorVersion < 5 && Target.Version.MinorVersion <= 21) { bUseRTTI = true; } PublicIncludePaths.AddRange( new string[] { // ... add public include paths required here ... } ); PrivateIncludePaths.AddRange( new string[] { // ... add other private include paths required here ... } ); PublicDependencyModuleNames.AddRange( new string[] { "UnrealEd", "UMG", "UMGEditor", "Core", "Json", "ContentBrowser", "SandboxFile", "JsonUtilities", "TargetPlatform", "DesktopPlatform", "Projects", "Settings", "HTTP", "RHI", "EngineSettings", "AssetRegistry", "PakFileUtilities", "HotPatcherRuntime", "BinariesPatchFeature" // ... add other public dependencies that you statically link with here ... } ); PrivateDependencyModuleNames.AddRange( new string[] { "DesktopPlatform", "InputCore", "CoreUObject", "Engine", "RenderCore" // ... add private dependencies that you statically link with here ... } ); if (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 21) { PrivateDependencyModuleNames.Add("RenderCore"); } else { PrivateDependencyModuleNames.Add("ShaderCore"); } if (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 23) { PublicDependencyModuleNames.AddRange(new string[] { "TraceLog" }); } // // only in UE5 if (Target.Version.MajorVersion > 4) { PublicDependencyModuleNames.AddRange(new string[] { "DeveloperToolSettings" }); } switch (Target.Configuration) { case UnrealTargetConfiguration.Debug: { PublicDefinitions.Add("COMPILER_CONFIGURATION_NAME=\"Debug\""); break; } case UnrealTargetConfiguration.DebugGame: { PublicDefinitions.Add("COMPILER_CONFIGURATION_NAME=\"DebugGame\""); break; } case UnrealTargetConfiguration.Development: { PublicDefinitions.Add("COMPILER_CONFIGURATION_NAME=\"Development\""); break; } default: { PublicDefinitions.Add("COMPILER_CONFIGURATION_NAME=\"\""); break; } } ; System.Func <string, bool, bool> AddPublicDefinitions = (string MacroName, bool bEnable) => { PublicDefinitions.Add(string.Format("{0}={1}", MacroName, bEnable ? 1 : 0)); return(true); }; bool bIOStoreSupport = Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 25; if (bIOStoreSupport) { PublicDependencyModuleNames.AddRange(new string[] { "IoStoreUtilities" }); } AddPublicDefinitions("WITH_IO_STORE_SUPPORT", bIOStoreSupport); AddPublicDefinitions("GENERATE_ASSET_REGISTRY_DATA", false); AddPublicDefinitions("ENABLE_COOK_LOG", true); AddPublicDefinitions("ENABLE_COOK_ENGINE_MAP", false); AddPublicDefinitions("ENABLE_COOK_PLUGIN_MAP", false); BuildVersion Version; BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version); AddPublicDefinitions("WITH_EDITOR_SECTION", Version.MajorVersion > 4 || Version.MinorVersion > 24); System.Console.WriteLine("MajorVersion {0} MinorVersion: {1} PatchVersion {2}", Target.Version.MajorVersion, Target.Version.MinorVersion, Target.Version.PatchVersion); // Game feature bool bEnableGameFeature = true; if (bEnableGameFeature || (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 26)) { PublicDependencyModuleNames.AddRange(new string[] { // "GameFeatures", // "ModularGameplay", }); } bool bEnablePackageContext = true; AddPublicDefinitions("WITH_PACKAGE_CONTEXT", (Version.MajorVersion > 4 || Version.MinorVersion > 23) && bEnablePackageContext); if (Version.MajorVersion > 4 || Version.MajorVersion > 26) { PublicDependencyModuleNames.AddRange(new string[] { "IoStoreUtilities", // "UnrealEd" }); } if (Version.MajorVersion > 4 && Version.MinorVersion > 0) { PublicIncludePaths.AddRange(new List <string>() { // Path.Combine(EngineDirectory,"Source/Developer/IoStoreUtilities/Internal"), // Path.Combine(EngineDirectory,"Source/Editor/UnrealEd/Private/Cooker"), // Path.Combine(EngineDirectory,"Source/Editor/UnrealEd/Private"), // Path.Combine(EngineDirectory,"Source/Runtime/CoreUObject/Internal"), Path.Combine(ModuleDirectory, "../CookerWriterForUE5") }); } }
public HotPatcherRuntime(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; PublicIncludePaths.AddRange( new string[] { Path.Combine(EngineDirectory, "Source/Runtime/Launch"), Path.Combine(ModuleDirectory, "Public") // ... add public include paths required here ... } ); PrivateIncludePaths.AddRange( new string[] { // ... add other private include paths required here ... } ); if (Target.bBuildEditor) { PublicDependencyModuleNames.Add("TargetPlatform"); } PublicDependencyModuleNames.AddRange( new string[] { "RHI", "Core", "Projects", "Json", "JsonUtilities", "PakFile", "AssetRegistry", "AssetManagerEx" // ... add other public dependencies that you statically link with here ... } ); // PackageContext { bool bEnablePackageContext = false; BuildVersion Version; if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version)) { if (Version.MajorVersion > 4 || Version.MinorVersion > 24) { PublicDefinitions.Add("WITH_PACKAGE_CONTEXT=1"); bEnablePackageContext = true; } } if (!bEnablePackageContext) { PublicDefinitions.Add("WITH_PACKAGE_CONTEXT=0"); } } PrivateDependencyModuleNames.AddRange( new string[] { "CoreUObject", "Engine", "Slate", "SlateCore" // ... add private dependencies that you statically link with here ... } ); if (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 21) { PrivateDependencyModuleNames.Add("RenderCore"); } else { PrivateDependencyModuleNames.Add("ShaderCore"); } bLegacyPublicIncludePaths = false; OptimizeCode = CodeOptimization.InShippingBuildsOnly; }
public MQTT(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; BuildVersion Version; if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version)) { if (Version.MajorVersion == 4 && Version.MinorVersion >= 26) { PrivateDependencyModuleNames.AddRange(new string[] { "CoreUObject", "Engine", "Slate", "SlateCore", "DeveloperSettings", }); } else { PrivateDependencyModuleNames.AddRange(new string[] { "CoreUObject", "Engine", "Slate", "SlateCore", }); } } PublicIncludePaths.AddRange(new string[] { }); PrivateIncludePaths.AddRange(new string[] { }); PublicDependencyModuleNames.AddRange(new string[] { "Core", }); DynamicallyLoadedModuleNames.AddRange(new string[] { }); /* * THIRDPARTY LIB * * Mosquitto */ PublicDefinitions.Add("WITH_MYTHIRDPARTYLIBRARY=1"); string LibKey = "libs"; string IncludeKey = "includes"; string ThirdPartyPath = Path.GetFullPath(Path.Combine(ModuleDirectory, "../../Source/ThirdParty/mosquitto")).ToString(); string BinaryPath = Path.GetFullPath(Path.Combine(ModuleDirectory, "../../Binaries", Target.Platform.ToString())).ToString(); string OsKey = Target.Platform == UnrealTargetPlatform.Linux ? "lnx64" : "win64"; string LibExt = Target.Platform == UnrealTargetPlatform.Linux ? ".so" : ".lib"; string DllExt = Target.Platform == UnrealTargetPlatform.Linux ? ".so" : ".dll"; string Mosquitto = Target.Platform == UnrealTargetPlatform.Linux ? "libmosquitto" : "mosquitto"; string Mosquittopp = Target.Platform == UnrealTargetPlatform.Linux ? "libmosquittopp" : "mosquittopp"; // Include libs PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, LibKey, OsKey, Mosquitto + LibExt)); PublicAdditionalLibraries.Add(Path.Combine(ThirdPartyPath, LibKey, OsKey, Mosquittopp + LibExt)); // Include path PublicIncludePaths.Add(Path.Combine(ThirdPartyPath, IncludeKey, OsKey)); // DLL if (Target.bBuildEditor) // In Editor { RuntimeDependencies.Add(new RuntimeDependency(Path.Combine(BinaryPath, Mosquitto + DllExt))); RuntimeDependencies.Add(new RuntimeDependency(Path.Combine(BinaryPath, Mosquittopp + DllExt))); if (!System.IO.Directory.Exists(BinaryPath)) { System.IO.Directory.CreateDirectory(BinaryPath); } File.Copy(Path.Combine(ThirdPartyPath, LibKey, OsKey, Mosquitto + DllExt), Path.Combine(BinaryPath, Mosquitto + DllExt), true); File.Copy(Path.Combine(ThirdPartyPath, LibKey, OsKey, Mosquittopp + DllExt), Path.Combine(BinaryPath, Mosquittopp + DllExt), true); } else // Create package : cooked project { RuntimeDependencies.Add(new RuntimeDependency(Path.Combine("$(BinaryOutputDir)", Mosquitto + DllExt), Path.Combine(BinaryPath, Mosquitto + DllExt))); RuntimeDependencies.Add(new RuntimeDependency(Path.Combine("$(BinaryOutputDir)", Mosquittopp + DllExt), Path.Combine(BinaryPath, Mosquittopp + DllExt))); } }
bool ResolveStagedReference(string InBuildReference, Func <string, string> ResolutionDelegate) { if (string.IsNullOrEmpty(InBuildReference)) { return(false); } // BuildParam could be a path, a name that we should resolve to a path, Staged, or Editor DirectoryInfo BuildDir = new DirectoryInfo(InBuildReference); string ResolvedName = null; string ResolvedPath = null; if (BuildDir.Exists) { // Easy option first - is this a full path? ResolvedName = BuildDir.Name; ResolvedPath = BuildDir.FullName; } else if (BuildDir.Name.Equals("staged", StringComparison.OrdinalIgnoreCase)) { // First special case - "Staged" means use whats locally staged ResolvedName = "Staged"; ResolvedPath = Path.Combine(UnrealPath, ProjectName, "Saved", "StagedBuilds"); if (Directory.Exists(ResolvedPath) == false) { Log.Error("BuildReference was Staged but staged directory {0} not found", ResolvedPath); return(false); } } else if (BuildDir.Name.Equals("editor", StringComparison.OrdinalIgnoreCase)) { // Second special case - "Editor" means run using the editor ResolvedName = "Editor"; ResolvedPath = UnrealPath; if (Directory.Exists(ResolvedPath) == false) { Log.Error("BuildReference was Editor but editor directory {0} not found", ResolvedPath); return(false); } } else { // todo - make this more generic if (BuildDir.Name.Equals("usesyncedbuild", StringComparison.OrdinalIgnoreCase)) { BuildVersion Version; if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version)) { InBuildReference = Version.BranchName + "-CL-" + Version.Changelist.ToString(); } } // See if it's in the passed locations if (ResolutionDelegate != null) { string FullPath = ResolutionDelegate(InBuildReference); if (string.IsNullOrEmpty(FullPath) == false) { DirectoryInfo Di = new DirectoryInfo(FullPath); if (Di.Exists == false) { throw new AutomationException("Resolution delegate returned non existent path"); } ResolvedName = Di.Name; ResolvedPath = Di.FullName; } } } if (string.IsNullOrEmpty(ResolvedPath)) { Log.Error("Unable to resolve build argument '{0}'", InBuildReference); return(false); } BuildName = ResolvedName; BuildPath = ResolvedPath; return(true); }
/// <summary> /// Generate HTML documentation for all the tasks /// </summary> /// <param name="NameToTask">Map of task name to implementation</param> /// <param name="OutputFile">Output file</param> static void GenerateDocumentation(Dictionary <string, ScriptTask> NameToTask, FileReference OutputFile) { // Find all the assemblies containing tasks Assembly[] TaskAssemblies = NameToTask.Values.Select(x => x.ParametersClass.Assembly).Distinct().ToArray(); // Read documentation for each of them Dictionary <string, XmlElement> MemberNameToElement = new Dictionary <string, XmlElement>(); foreach (Assembly TaskAssembly in TaskAssemblies) { string XmlFileName = Path.ChangeExtension(TaskAssembly.Location, ".xml"); if (File.Exists(XmlFileName)) { // Read the document XmlDocument Document = new XmlDocument(); Document.Load(XmlFileName); // Parse all the members, and add them to the map foreach (XmlElement Element in Document.SelectNodes("/doc/members/member")) { string Name = Element.GetAttribute("name"); MemberNameToElement.Add(Name, Element); } } } // Create the output directory DirectoryReference.CreateDirectory(OutputFile.Directory); FileReference.MakeWriteable(OutputFile); Log("Writing {0}...", OutputFile); // Parse the engine version BuildVersion Version; if (!BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version)) { throw new AutomationException("Couldn't read Build.version"); } // Write the output file using (StreamWriter Writer = new StreamWriter(OutputFile.FullName)) { Writer.WriteLine("Availability: NoPublish"); Writer.WriteLine("Title: BuildGraph Predefined Tasks"); Writer.WriteLine("Crumbs: %ROOT%, Programming, Programming/Development, Programming/Development/BuildGraph, Programming/Development/BuildGraph/BuildGraphScriptTasks"); Writer.WriteLine("Description: This is a procedurally generated markdown page."); Writer.WriteLine("version: {0}.{1}", Version.MajorVersion, Version.MinorVersion); Writer.WriteLine("parent:Programming/Development/BuildGraph/BuildGraphScriptTasks"); Writer.WriteLine(); foreach (string TaskName in NameToTask.Keys.OrderBy(x => x)) { // Get the task object ScriptTask Task = NameToTask[TaskName]; // Get the documentation for this task XmlElement TaskElement; if (MemberNameToElement.TryGetValue("T:" + Task.TaskClass.FullName, out TaskElement)) { // Write the task heading Writer.WriteLine("### {0}", TaskName); Writer.WriteLine(); Writer.WriteLine(ConvertToMarkdown(TaskElement.SelectSingleNode("summary"))); Writer.WriteLine(); // Document the parameters List <string[]> Rows = new List <string[]>(); foreach (string ParameterName in Task.NameToParameter.Keys) { // Get the parameter data ScriptTaskParameter Parameter = Task.NameToParameter[ParameterName]; // Get the documentation for this parameter XmlElement ParameterElement; if (MemberNameToElement.TryGetValue("F:" + Parameter.FieldInfo.DeclaringType.FullName + "." + Parameter.Name, out ParameterElement)) { string TypeName = Parameter.FieldInfo.FieldType.Name; if (Parameter.ValidationType != TaskParameterValidationType.Default) { StringBuilder NewTypeName = new StringBuilder(Parameter.ValidationType.ToString()); for (int Idx = 1; Idx < NewTypeName.Length; Idx++) { if (Char.IsLower(NewTypeName[Idx - 1]) && Char.IsUpper(NewTypeName[Idx])) { NewTypeName.Insert(Idx, ' '); } } TypeName = NewTypeName.ToString(); } string[] Columns = new string[4]; Columns[0] = ParameterName; Columns[1] = TypeName; Columns[2] = Parameter.bOptional? "Optional" : "Required"; Columns[3] = ConvertToMarkdown(ParameterElement.SelectSingleNode("summary")); Rows.Add(Columns); } } // Always include the "If" attribute string[] IfColumns = new string[4]; IfColumns[0] = "If"; IfColumns[1] = "Condition"; IfColumns[2] = "Optional"; IfColumns[3] = "Whether to execute this task. It is ignored if this condition evaluates to false."; Rows.Add(IfColumns); // Get the width of each column int[] Widths = new int[4]; for (int Idx = 0; Idx < 4; Idx++) { Widths[Idx] = Rows.Max(x => x[Idx].Length); } // Format the markdown table string Format = String.Format("| {{0,-{0}}} | {{1,-{1}}} | {{2,-{2}}} | {{3,-{3}}} |", Widths[0], Widths[1], Widths[2], Widths[3]); Writer.WriteLine(Format, "", "", "", ""); Writer.WriteLine(Format, new string('-', Widths[0]), new string('-', Widths[1]), new string('-', Widths[2]), new string('-', Widths[3])); for (int Idx = 0; Idx < Rows.Count; Idx++) { Writer.WriteLine(Format, Rows[Idx][0], Rows[Idx][1], Rows[Idx][2], Rows[Idx][3]); } // Blank line before next task Writer.WriteLine(); } } } }
/// <summary> /// Main entry point for the BuildGraph command /// </summary> public override ExitCode Execute() { // Parse the command line parameters string ScriptFileName = ParseParamValue("Script", null); string TargetNames = ParseParamValue("Target", null); string DocumentationFileName = ParseParamValue("Documentation", null); string SchemaFileName = ParseParamValue("Schema", null); string ExportFileName = ParseParamValue("Export", null); string PreprocessedFileName = ParseParamValue("Preprocess", null); string SharedStorageDir = ParseParamValue("SharedStorageDir", null); string SingleNodeName = ParseParamValue("SingleNode", null); string TriggerName = ParseParamValue("Trigger", null); string[] SkipTriggerNames = ParseParamValue("SkipTrigger", "").Split(new char[] { '+', ';' }, StringSplitOptions.RemoveEmptyEntries).ToArray(); bool bSkipTriggers = ParseParam("SkipTriggers"); string TokenSignature = ParseParamValue("TokenSignature", null); bool bSkipTargetsWithoutTokens = ParseParam("SkipTargetsWithoutTokens"); bool bResume = SingleNodeName != null || ParseParam("Resume"); bool bListOnly = ParseParam("ListOnly"); bool bShowDiagnostics = ParseParam("ShowDiagnostics"); bool bWriteToSharedStorage = ParseParam("WriteToSharedStorage") || CommandUtils.IsBuildMachine; bool bPublicTasksOnly = ParseParam("PublicTasksOnly"); string ReportName = ParseParamValue("ReportName", null); GraphPrintOptions PrintOptions = GraphPrintOptions.ShowCommandLineOptions; if (ParseParam("ShowDeps")) { PrintOptions |= GraphPrintOptions.ShowDependencies; } if (ParseParam("ShowNotifications")) { PrintOptions |= GraphPrintOptions.ShowNotifications; } // Parse any specific nodes to clean List <string> CleanNodes = new List <string>(); foreach (string NodeList in ParseParamValues("CleanNode")) { foreach (string NodeName in NodeList.Split('+', ';')) { CleanNodes.Add(NodeName); } } // Set up the standard properties which build scripts might need Dictionary <string, string> DefaultProperties = new Dictionary <string, string>(StringComparer.InvariantCultureIgnoreCase); DefaultProperties["Branch"] = P4Enabled ? P4Env.Branch : "Unknown"; DefaultProperties["Depot"] = P4Enabled ? DefaultProperties["Branch"].Substring(2).Split('/').First() : "Unknown"; DefaultProperties["EscapedBranch"] = P4Enabled ? CommandUtils.EscapePath(P4Env.Branch) : "Unknown"; DefaultProperties["Change"] = P4Enabled ? P4Env.Changelist.ToString() : "0"; DefaultProperties["CodeChange"] = P4Enabled ? P4Env.CodeChangelist.ToString() : "0"; DefaultProperties["RootDir"] = CommandUtils.RootDirectory.FullName; DefaultProperties["IsBuildMachine"] = IsBuildMachine ? "true" : "false"; DefaultProperties["HostPlatform"] = HostPlatform.Current.HostEditorPlatform.ToString(); DefaultProperties["RestrictedFolderNames"] = String.Join(";", RestrictedFolders.Names); DefaultProperties["RestrictedFolderFilter"] = String.Join(";", RestrictedFolders.Names.Select(x => String.Format(".../{0}/...", x))); // Attempt to read existing Build Version information BuildVersion Version; if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version)) { DefaultProperties["EngineMajorVersion"] = Version.MajorVersion.ToString(); DefaultProperties["EngineMinorVersion"] = Version.MinorVersion.ToString(); DefaultProperties["EnginePatchVersion"] = Version.PatchVersion.ToString(); DefaultProperties["EngineCompatibleChange"] = Version.CompatibleChangelist.ToString(); } // Add any additional custom arguments from the command line (of the form -Set:X=Y) Dictionary <string, string> Arguments = new Dictionary <string, string>(StringComparer.InvariantCultureIgnoreCase); foreach (string Param in Params) { const string Prefix = "set:"; if (Param.StartsWith(Prefix, StringComparison.InvariantCultureIgnoreCase)) { int EqualsIdx = Param.IndexOf('='); if (EqualsIdx >= 0) { Arguments[Param.Substring(Prefix.Length, EqualsIdx - Prefix.Length)] = Param.Substring(EqualsIdx + 1); } else { LogWarning("Missing value for '{0}'", Param.Substring(Prefix.Length)); } } } // Find all the tasks from the loaded assemblies Dictionary <string, ScriptTask> NameToTask = new Dictionary <string, ScriptTask>(); if (!FindAvailableTasks(NameToTask, bPublicTasksOnly)) { return(ExitCode.Error_Unknown); } // Generate documentation if (DocumentationFileName != null) { GenerateDocumentation(NameToTask, new FileReference(DocumentationFileName)); return(ExitCode.Success); } // Create a schema for the given tasks ScriptSchema Schema = new ScriptSchema(NameToTask); if (SchemaFileName != null) { FileReference FullSchemaFileName = new FileReference(SchemaFileName); LogInformation("Writing schema to {0}...", FullSchemaFileName.FullName); Schema.Export(FullSchemaFileName); if (ScriptFileName == null) { return(ExitCode.Success); } } // Check there was a script specified if (ScriptFileName == null) { LogError("Missing -Script= parameter for BuildGraph"); return(ExitCode.Error_Unknown); } // Read the script from disk Graph Graph; if (!ScriptReader.TryRead(new FileReference(ScriptFileName), Arguments, DefaultProperties, Schema, out Graph)) { return(ExitCode.Error_Unknown); } // Create the temp storage handler DirectoryReference RootDir = new DirectoryReference(CommandUtils.CmdEnv.LocalRoot); TempStorage Storage = new TempStorage(RootDir, DirectoryReference.Combine(RootDir, "Engine", "Saved", "BuildGraph"), (SharedStorageDir == null)? null : new DirectoryReference(SharedStorageDir), bWriteToSharedStorage); if (!bResume) { Storage.CleanLocal(); } foreach (string CleanNode in CleanNodes) { Storage.CleanLocalNode(CleanNode); } // Convert the supplied target references into nodes HashSet <Node> TargetNodes = new HashSet <Node>(); if (TargetNames == null) { if (!bListOnly) { LogError("Missing -Target= parameter for BuildGraph"); return(ExitCode.Error_Unknown); } TargetNodes.UnionWith(Graph.Agents.SelectMany(x => x.Nodes)); } else { foreach (string TargetName in TargetNames.Split(new char[] { '+', ';' }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim())) { Node[] Nodes; if (!Graph.TryResolveReference(TargetName, out Nodes)) { LogError("Target '{0}' is not in graph", TargetName); return(ExitCode.Error_Unknown); } TargetNodes.UnionWith(Nodes); } } // Try to acquire tokens for all the target nodes we want to build if (TokenSignature != null) { // Find all the lock files HashSet <FileReference> RequiredTokens = new HashSet <FileReference>(TargetNodes.SelectMany(x => x.RequiredTokens)); // List out all the required tokens if (SingleNodeName == null) { CommandUtils.LogInformation("Required tokens:"); foreach (Node Node in TargetNodes) { foreach (FileReference RequiredToken in Node.RequiredTokens) { CommandUtils.LogInformation(" '{0}' requires {1}", Node, RequiredToken); } } } // Try to create all the lock files List <FileReference> CreatedTokens = new List <FileReference>(); if (!bListOnly) { CreatedTokens.AddRange(RequiredTokens.Where(x => WriteTokenFile(x, TokenSignature))); } // Find all the tokens that we don't have Dictionary <FileReference, string> MissingTokens = new Dictionary <FileReference, string>(); foreach (FileReference RequiredToken in RequiredTokens) { string CurrentOwner = ReadTokenFile(RequiredToken); if (CurrentOwner != null && CurrentOwner != TokenSignature) { MissingTokens.Add(RequiredToken, CurrentOwner); } } // If we want to skip all the nodes with missing locks, adjust the target nodes to account for it if (MissingTokens.Count > 0) { if (bSkipTargetsWithoutTokens) { // Find all the nodes we're going to skip HashSet <Node> SkipNodes = new HashSet <Node>(); foreach (IGrouping <string, FileReference> MissingTokensForBuild in MissingTokens.GroupBy(x => x.Value, x => x.Key)) { LogInformation("Skipping the following nodes due to {0}:", MissingTokensForBuild.Key); foreach (FileReference MissingToken in MissingTokensForBuild) { foreach (Node SkipNode in TargetNodes.Where(x => x.RequiredTokens.Contains(MissingToken) && SkipNodes.Add(x))) { LogInformation(" {0}", SkipNode); } } } // Write a list of everything left over if (SkipNodes.Count > 0) { TargetNodes.ExceptWith(SkipNodes); LogInformation("Remaining target nodes:"); foreach (Node TargetNode in TargetNodes) { LogInformation(" {0}", TargetNode); } if (TargetNodes.Count == 0) { LogInformation(" None."); } } } else { foreach (KeyValuePair <FileReference, string> Pair in MissingTokens) { List <Node> SkipNodes = TargetNodes.Where(x => x.RequiredTokens.Contains(Pair.Key)).ToList(); LogError("Cannot run {0} due to previous build: {1}", String.Join(", ", SkipNodes), Pair.Value); } foreach (FileReference CreatedToken in CreatedTokens) { FileReference.Delete(CreatedToken); } return(ExitCode.Error_Unknown); } } } // Cull the graph to include only those nodes Graph.Select(TargetNodes); // Collapse any triggers in the graph which are marked to be skipped HashSet <ManualTrigger> SkipTriggers = new HashSet <ManualTrigger>(); if (bSkipTriggers) { SkipTriggers.UnionWith(Graph.NameToTrigger.Values); } else { foreach (string SkipTriggerName in SkipTriggerNames) { ManualTrigger SkipTrigger; if (!Graph.NameToTrigger.TryGetValue(TriggerName, out SkipTrigger)) { LogError("Couldn't find trigger '{0}'", TriggerName); return(ExitCode.Error_Unknown); } SkipTriggers.Add(SkipTrigger); } } Graph.SkipTriggers(SkipTriggers); // If a report for the whole build was requested, insert it into the graph if (ReportName != null) { Report NewReport = new Report(ReportName); NewReport.Nodes.UnionWith(Graph.Agents.SelectMany(x => x.Nodes)); Graph.NameToReport.Add(ReportName, NewReport); } // Write out the preprocessed script if (PreprocessedFileName != null) { FileReference PreprocessedFileLocation = new FileReference(PreprocessedFileName); LogInformation("Writing {0}...", PreprocessedFileLocation); Graph.Write(PreprocessedFileLocation, (SchemaFileName != null)? new FileReference(SchemaFileName) : null); return(ExitCode.Success); } // Find the triggers which we are explicitly running. ManualTrigger Trigger = null; if (TriggerName != null && !Graph.NameToTrigger.TryGetValue(TriggerName, out Trigger)) { LogError("Couldn't find trigger '{0}'", TriggerName); return(ExitCode.Error_Unknown); } // If we're just building a single node, find it Node SingleNode = null; if (SingleNodeName != null && !Graph.NameToNode.TryGetValue(SingleNodeName, out SingleNode)) { LogError("Node '{0}' is not in the trimmed graph", SingleNodeName); return(ExitCode.Error_Unknown); } // If we just want to show the contents of the graph, do so and exit. if (bListOnly) { HashSet <Node> CompletedNodes = FindCompletedNodes(Graph, Storage); Graph.Print(CompletedNodes, PrintOptions); } // Print out all the diagnostic messages which still apply, unless we're running a step as part of a build system or just listing the contents of the file. if (SingleNode == null && (!bListOnly || bShowDiagnostics)) { IEnumerable <GraphDiagnostic> Diagnostics = Graph.Diagnostics.Where(x => x.EnclosingTrigger == Trigger); foreach (GraphDiagnostic Diagnostic in Diagnostics) { if (Diagnostic.EventType == LogEventType.Console) { CommandUtils.LogInformation(Diagnostic.Message); } else if (Diagnostic.EventType == LogEventType.Warning) { CommandUtils.LogWarning(Diagnostic.Message); } else { CommandUtils.LogError(Diagnostic.Message); } } if (Diagnostics.Any(x => x.EventType == LogEventType.Error)) { return(ExitCode.Error_Unknown); } } // Export the graph to a file if (ExportFileName != null) { HashSet <Node> CompletedNodes = FindCompletedNodes(Graph, Storage); Graph.Print(CompletedNodes, PrintOptions); Graph.Export(new FileReference(ExportFileName), Trigger, CompletedNodes); return(ExitCode.Success); } // Execute the command if (!bListOnly) { if (SingleNode != null) { if (!BuildNode(new JobContext(this), Graph, SingleNode, Storage, bWithBanner: true)) { return(ExitCode.Error_Unknown); } } else { if (!BuildAllNodes(new JobContext(this), Graph, Storage)) { return(ExitCode.Error_Unknown); } } } return(ExitCode.Success); }
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); }
public UnrealEnginePython(TargetInfo Target) #endif { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; string enableUnityBuild = System.Environment.GetEnvironmentVariable("UEP_ENABLE_UNITY_BUILD"); bFasterWithoutUnity = string.IsNullOrEmpty(enableUnityBuild); PublicIncludePaths.AddRange( new string[] { // ... add public include paths required here ... } ); PrivateIncludePaths.AddRange( new string[] { // ... add other private include paths required here ... } ); PublicDependencyModuleNames.AddRange( new string[] { "Core", "Sockets", "Networking" // ... add other public dependencies that you statically link with here ... } ); PrivateDependencyModuleNames.AddRange( new string[] { "CoreUObject", "Engine", "InputCore", "Slate", "SlateCore", "MovieScene", "LevelSequence", "HTTP", "UMG", "AppFramework", "RHI", "Voice", "RenderCore", "MovieSceneCapture", "Landscape", "Foliage", "AIModule" // ... add private dependencies that you statically link with here ... } ); #if WITH_FORWARDED_MODULE_RULES_CTOR BuildVersion Version; if (BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version)) { if (Version.MinorVersion >= 18) { PrivateDependencyModuleNames.Add("ApplicationCore"); } } #endif DynamicallyLoadedModuleNames.AddRange( new string[] { // ... add any modules that your module loads dynamically here ... } ); #if WITH_FORWARDED_MODULE_RULES_CTOR if (Target.bBuildEditor) #else if (UEBuildConfiguration.bBuildEditor) #endif { PrivateDependencyModuleNames.AddRange(new string[] { "UnrealEd", "LevelEditor", "BlueprintGraph", "Projects", "Sequencer", "SequencerWidgets", "AssetTools", "LevelSequenceEditor", "MovieSceneTools", "MovieSceneTracks", "CinematicCamera", "EditorStyle", "GraphEditor", "UMGEditor", "AIGraph", "RawMesh", "DesktopWidgets", "EditorWidgets", "FBX", "Persona", "PropertyEditor", "LandscapeEditor", "MaterialEditor" }); } if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32)) { if (pythonHome == "") { pythonHome = DiscoverPythonPath(windowsKnownPaths, "Win64"); if (pythonHome == "") { throw new System.Exception("Unable to find Python installation"); } } System.Console.WriteLine("Using Python at: " + pythonHome); PublicIncludePaths.Add(pythonHome); string libPath = GetWindowsPythonLibFile(pythonHome); PublicLibraryPaths.Add(Path.GetDirectoryName(libPath)); PublicAdditionalLibraries.Add(libPath); } else if (Target.Platform == UnrealTargetPlatform.Mac) { if (pythonHome == "") { pythonHome = DiscoverPythonPath(macKnownPaths, "Mac"); if (pythonHome == "") { throw new System.Exception("Unable to find Python installation"); } } System.Console.WriteLine("Using Python at: " + pythonHome); PublicIncludePaths.Add(pythonHome); string libPath = GetMacPythonLibFile(pythonHome); PublicLibraryPaths.Add(Path.GetDirectoryName(libPath)); PublicDelayLoadDLLs.Add(libPath); } else if (Target.Platform == UnrealTargetPlatform.Linux) { if (pythonHome == "") { string includesPath = DiscoverLinuxPythonIncludesPath(); if (includesPath == null) { throw new System.Exception("Unable to find Python includes, please add a search path to linuxKnownIncludesPaths"); } string libsPath = DiscoverLinuxPythonLibsPath(); if (libsPath == null) { throw new System.Exception("Unable to find Python libs, please add a search path to linuxKnownLibsPaths"); } PublicIncludePaths.Add(includesPath); PublicAdditionalLibraries.Add(libsPath); } else { string[] items = pythonHome.Split(';'); PublicIncludePaths.Add(items[0]); PublicAdditionalLibraries.Add(items[1]); } } #if WITH_FORWARDED_MODULE_RULES_CTOR else if (Target.Platform == UnrealTargetPlatform.Android) { PublicIncludePaths.Add(System.IO.Path.Combine(ModuleDirectory, "../../android/python35/include")); PublicLibraryPaths.Add(System.IO.Path.Combine(ModuleDirectory, "../../android/armeabi-v7a")); PublicAdditionalLibraries.Add("python3.5m"); string APLName = "UnrealEnginePython_APL.xml"; string RelAPLPath = Utils.MakePathRelativeTo(System.IO.Path.Combine(ModuleDirectory, APLName), Target.RelativeEnginePath); AdditionalPropertiesForReceipt.Add(new ReceiptProperty("AndroidPlugin", RelAPLPath)); } #endif }
public HotPatcherEditor(ReadOnlyTargetRules Target) : base(Target) { PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; bLegacyPublicIncludePaths = false; OptimizeCode = CodeOptimization.InShippingBuildsOnly; if (Target.Version.MajorVersion < 5 && Target.Version.MinorVersion <= 21) { bUseRTTI = true; } PublicIncludePaths.AddRange(new string[] { }); PrivateIncludePaths.AddRange(new string[] {}); PublicDependencyModuleNames.AddRange( new string[] { "UnrealEd", "UMG", "UMGEditor", "Core", "Json", "ContentBrowser", "SandboxFile", "JsonUtilities", "TargetPlatform", "DesktopPlatform", "Projects", "Settings", "HTTP", "RHI", "EngineSettings", "AssetRegistry", "PakFileUtilities", "HotPatcherRuntime", "BinariesPatchFeature", "HotPatcherCore" // ... add other public dependencies that you statically link with here ... } ); PrivateDependencyModuleNames.AddRange( new string[] { "Core", "UnrealEd", "Projects", "DesktopPlatform", "InputCore", "EditorStyle", "LevelEditor", "CoreUObject", "Engine", "Slate", "SlateCore", "RenderCore" // ... add private dependencies that you statically link with here ... } ); if (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 23) { PublicDependencyModuleNames.AddRange(new string[] { "ToolMenus", "TraceLog" }); } System.Func <string, bool, bool> AddPublicDefinitions = (string MacroName, bool bEnable) => { PublicDefinitions.Add(string.Format("{0}={1}", MacroName, bEnable ? 1 : 0)); return(true); }; AddPublicDefinitions("ENABLE_COOK_ENGINE_MAP", false); AddPublicDefinitions("ENABLE_COOK_PLUGIN_MAP", false); BuildVersion Version; BuildVersion.TryRead(BuildVersion.GetDefaultFileName(), out Version); AddPublicDefinitions("WITH_EDITOR_SECTION", Version.MajorVersion > 4 || Version.MinorVersion > 24); // Game feature bool bEnableGameFeature = false; AddPublicDefinitions("ENGINE_GAME_FEATURE", bEnableGameFeature || (Target.Version.MajorVersion > 4 || Target.Version.MinorVersion > 26)); System.Console.WriteLine("MajorVersion {0} MinorVersion: {1} PatchVersion {2}", Target.Version.MajorVersion, Target.Version.MinorVersion, Target.Version.PatchVersion); PublicDefinitions.AddRange(new string[] { "ENABLE_UPDATER_CHECK=1", "ENABLE_MULTI_COOKER=0", "TOOL_NAME=\"HotPatcher\"", "CURRENT_VERSION_ID=75", "CURRENT_PATCH_ID=2", "REMOTE_VERSION_FILE=\"https://imzlp.com/opensource/version.json\"" }); bool bEnablePackageContext = true; AddPublicDefinitions("WITH_PACKAGE_CONTEXT", (Version.MajorVersion > 4 || Version.MinorVersion > 23) && bEnablePackageContext); if (Version.MajorVersion > 4 || Version.MajorVersion > 26) { PublicDependencyModuleNames.AddRange(new string[] { "IoStoreUtilities", "UnrealEd" }); } }