You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
========================== MAJOR FEATURES + CHANGES ========================== Change 2718441 on 2015/10/06 by Ben.Marsh@Ben.Marsh_T3245_Stream Allow nodes to be added with an "explicit" frequency, meaning that they'll only be part of manually triggered builds (not CIS). Change 2718698 on 2015/10/06 by Ben.Marsh@Ben.Marsh_T3245_Stream Add a type of node that can execute an arbitrary sequence of tasks, and allow constructing graphs of such nodes from an XML file. Change 2723013 on 2015/10/09 by Ben.Marsh@Ben.Marsh_T3245_Stream Small utility to quickly capture a workspace, or delete files to restore the workspace to a previously captured state (and output a p4 sync list to restore it) Change 2744521 on 2015/10/28 by Matthew.Griffin@Matthew.Griffin_G5772_BuildStream Adding config entries to determine which platforms/configurations are available Currently only written out as part of the Rocket Build process but could be done elsewhere for other types of installed build. A near identical singleton class is used in both C++ and C# to load the config section and check whether configuration/platform combinations are valid. Change 2773723 on 2015/11/19 by Ben.Marsh@Ben.Marsh_T3245_Stream Copying UnrealGameSync into Engine/Source/Programs. Change 2773914 on 2015/11/19 by Ben.Marsh@Ben.Marsh_T3245_Stream PR #1687: [GitDependencies] New feature: ignore file support (.gitdepsignore) (Contributed by nbjk667) Change 2775317 on 2015/11/20 by Ben.Marsh@Ben.Marsh_T3245_Stream Add a -listtps option to UBT, which will find all the TPS files in any directory that's compiled into a target. Change 2780832 on 2015/11/25 by Ben.Marsh@Ben.Marsh_T3245_Stream Allow compiling a single file in UBT. Pass -singlefile=<Path> on command line to UBT to use. Change 2781071 on 2015/11/25 by Ben.Marsh@Ben.Marsh_T3245_Stream Precompile all valid engine modules for Rocket by default. Modules may set the PrecompileForTargets field to control which configurations they should be compiled for. Modules which currently fail to compile have this set to PrecompileTargetsType.None. #codereview Matthew.Griffin Change 2784469 on 2015/12/01 by Matthew.Griffin@Matthew.Griffin_G5772_BuildStream Added -FastPDB commandline parameter for UBT, so that we can make use of the /DEBUG:FASTLINK option in VS2015 Change 2784722 on 2015/12/01 by Matthew.Griffin@Matthew.Griffin_G5772_BuildStream Made -FastPDB option part of BuildConfiguration instead of checking commandline at each place it's used. Also added option to override if someone doesn't want it automatically added to their project files. Change 2787501 on 2015/12/02 by Ben.Marsh@Ben.Marsh_T3245_Stream Restore change to gather VC environment directly from registry. #lockdown Nick.Penwarden [CL 2790002 by Ben Marsh in Main branch]
202 lines
6.0 KiB
C#
202 lines
6.0 KiB
C#
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
|
|
namespace UnrealBuildTool
|
|
{
|
|
public enum ModuleHostType
|
|
{
|
|
Default,
|
|
Runtime,
|
|
RuntimeNoCommandlet,
|
|
Developer,
|
|
Editor,
|
|
EditorNoCommandlet,
|
|
Program,
|
|
ServerOnly,
|
|
}
|
|
|
|
public enum ModuleLoadingPhase
|
|
{
|
|
Default,
|
|
PostDefault,
|
|
PreDefault,
|
|
PostConfigInit,
|
|
PreLoadingScreen,
|
|
PostEngineInit,
|
|
}
|
|
|
|
[DebuggerDisplay("Name={Name}")]
|
|
public class ModuleDescriptor
|
|
{
|
|
// Name of this module
|
|
public readonly string Name;
|
|
|
|
// Usage type of module
|
|
public ModuleHostType Type;
|
|
|
|
// When should the module be loaded during the startup sequence? This is sort of an advanced setting.
|
|
public ModuleLoadingPhase LoadingPhase = ModuleLoadingPhase.Default;
|
|
|
|
// List of allowed platforms
|
|
public UnrealTargetPlatform[] WhitelistPlatforms;
|
|
|
|
// List of disallowed platforms
|
|
public UnrealTargetPlatform[] BlacklistPlatforms;
|
|
|
|
// List of additional dependencies for building this module.
|
|
public string[] AdditionalDependencies;
|
|
|
|
/// <summary>
|
|
/// Constructor
|
|
/// </summary>
|
|
/// <param name="InName">Name of the module</param>
|
|
/// <param name="InType">Type of target that can host this module</param>
|
|
public ModuleDescriptor(string InName, ModuleHostType InType)
|
|
{
|
|
Name = InName;
|
|
Type = InType;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Constructs a ModuleDescriptor from a Json object
|
|
/// </summary>
|
|
/// <param name="InObject"></param>
|
|
/// <returns>The new module descriptor</returns>
|
|
public static ModuleDescriptor FromJsonObject(JsonObject InObject)
|
|
{
|
|
ModuleDescriptor Module = new ModuleDescriptor(InObject.GetStringField("Name"), InObject.GetEnumField<ModuleHostType>("Type"));
|
|
|
|
ModuleLoadingPhase LoadingPhase;
|
|
if (InObject.TryGetEnumField<ModuleLoadingPhase>("LoadingPhase", out LoadingPhase))
|
|
{
|
|
Module.LoadingPhase = LoadingPhase;
|
|
}
|
|
|
|
UnrealTargetPlatform[] WhitelistPlatforms;
|
|
if (InObject.TryGetEnumArrayField<UnrealTargetPlatform>("WhitelistPlatforms", out WhitelistPlatforms))
|
|
{
|
|
Module.WhitelistPlatforms = WhitelistPlatforms;
|
|
}
|
|
|
|
UnrealTargetPlatform[] BlacklistPlatforms;
|
|
if (InObject.TryGetEnumArrayField<UnrealTargetPlatform>("BlacklistPlatforms", out BlacklistPlatforms))
|
|
{
|
|
Module.BlacklistPlatforms = BlacklistPlatforms;
|
|
}
|
|
|
|
string[] AdditionalDependencies;
|
|
if (InObject.TryGetStringArrayField("AdditionalDependencies", out AdditionalDependencies))
|
|
{
|
|
Module.AdditionalDependencies = AdditionalDependencies;
|
|
}
|
|
|
|
return Module;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Write this module to a JsonWriter
|
|
/// </summary>
|
|
/// <param name="Writer">Writer to output to</param>
|
|
void Write(JsonWriter Writer)
|
|
{
|
|
Writer.WriteObjectStart();
|
|
Writer.WriteValue("Name", Name);
|
|
Writer.WriteValue("Type", Type.ToString());
|
|
Writer.WriteValue("LoadingPhase", LoadingPhase.ToString());
|
|
if (WhitelistPlatforms != null && WhitelistPlatforms.Length > 0)
|
|
{
|
|
Writer.WriteArrayStart("WhitelistPlatforms");
|
|
foreach (UnrealTargetPlatform WhitelistPlatform in WhitelistPlatforms)
|
|
{
|
|
Writer.WriteValue(WhitelistPlatform.ToString());
|
|
}
|
|
Writer.WriteArrayEnd();
|
|
}
|
|
if (BlacklistPlatforms != null && BlacklistPlatforms.Length > 0)
|
|
{
|
|
Writer.WriteArrayStart("BlacklistPlatforms");
|
|
foreach (UnrealTargetPlatform BlacklistPlatform in BlacklistPlatforms)
|
|
{
|
|
Writer.WriteValue(BlacklistPlatform.ToString());
|
|
}
|
|
Writer.WriteArrayEnd();
|
|
}
|
|
if (AdditionalDependencies != null && AdditionalDependencies.Length > 0)
|
|
{
|
|
Writer.WriteArrayStart("AdditionalDependencies");
|
|
foreach (string AdditionalDependency in AdditionalDependencies)
|
|
{
|
|
Writer.WriteValue(AdditionalDependency);
|
|
}
|
|
Writer.WriteArrayEnd();
|
|
}
|
|
Writer.WriteObjectEnd();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Write an array of module descriptors
|
|
/// </summary>
|
|
/// <param name="Writer">The Json writer to output to</param>
|
|
/// <param name="Name">Name of the array</param>
|
|
/// <param name="Modules">Array of modules</param>
|
|
public static void WriteArray(JsonWriter Writer, string Name, ModuleDescriptor[] Modules)
|
|
{
|
|
if (Modules.Length > 0)
|
|
{
|
|
Writer.WriteArrayStart(Name);
|
|
foreach (ModuleDescriptor Module in Modules)
|
|
{
|
|
Module.Write(Writer);
|
|
}
|
|
Writer.WriteArrayEnd();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Determines whether the given plugin module is part of the current build.
|
|
/// </summary>
|
|
/// <param name="Platform">The platform being compiled for</param>
|
|
/// <param name="TargetType">The type of the target being compiled</param>
|
|
/// <param name="bBuildDeveloperTools">Whether the configuration includes developer tools (typically UEBuildConfiguration.bBuildDeveloperTools for UBT callers)</param>
|
|
/// <param name="bBuildEditor">Whether the configuration includes the editor (typically UEBuildConfiguration.bBuildEditor for UBT callers)</param>
|
|
public bool IsCompiledInConfiguration(UnrealTargetPlatform Platform, TargetRules.TargetType TargetType, bool bBuildDeveloperTools, bool bBuildEditor)
|
|
{
|
|
// Check the platform is whitelisted
|
|
if (WhitelistPlatforms != null && WhitelistPlatforms.Length > 0 && !WhitelistPlatforms.Contains(Platform))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
// Check the platform is not blacklisted
|
|
if (BlacklistPlatforms != null && BlacklistPlatforms.Contains(Platform))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
// Check the module is compatible with this target.
|
|
switch (Type)
|
|
{
|
|
case ModuleHostType.Runtime:
|
|
case ModuleHostType.RuntimeNoCommandlet:
|
|
return true;
|
|
case ModuleHostType.Developer:
|
|
return bBuildDeveloperTools;
|
|
case ModuleHostType.Editor:
|
|
case ModuleHostType.EditorNoCommandlet:
|
|
return TargetType == TargetRules.TargetType.Editor || bBuildEditor;
|
|
case ModuleHostType.Program:
|
|
return TargetType == TargetRules.TargetType.Program;
|
|
case ModuleHostType.ServerOnly:
|
|
return TargetType != TargetRules.TargetType.Client;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|