You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#lockdown Nick.Penwarden
============================
MAJOR FEATURES & CHANGES
============================
Change 4287066 by Ben.Marsh
BuildGraph: Prevent errors being shown when running with -listonly.
Change 4288274 by Ben.Marsh
If unable to get dbghelp module info, fallback to use available module info (fixes PC calculations for portable stack walk)
(Originally CL 4206596 by Josh.Engerbretson)
Change 4303760 by Ben.Marsh
Automatically apply XML config to all platform rules objects.
Change 4304461 by Mike.Erwin
UAT: fix breakage when cooking Blueprint projects
Yesterday I broke this in CL 4301305. Reworked logic around the -server option was causing
"ERROR: Server target not found. Server target is required with -server and -cook or -cookonthefly"
This CL fixes projects that don't have a Server.Target.cs but want to -cook.
#jira UE-60512
Change 4304652 by Ben.Marsh
Improve error message when unable to parse the current CL from a stream.
Change 4304795 by Ben.Marsh
Fix occasional incremental build error in AutomationScripts project. Explicit dependency on Localization output file was invalidating project dependency.
Change 4307117 by Ben.Marsh
UAT: Fix problems making installed builds with Lumin enabled, when passing the -Clean argument to UAT.
* UE4Build was deleting all files in the manifest before running, even if they were output by UBT.
* Lumin was specifying AllowParallelExecutor="false" in InstalledEngineBuild.xml, which was causing each compile to be executed in isolation. Since modules are now compiled into object files separately to being linked into binaries, this was causing object files and .precompiled files to be deleted during the clean operation.
* Individual compile tasks can now override the global "clean' option.
Change 4307187 by Ben.Marsh
UAT: Remove code for deleting build products and retrying XGE compiles.
Change 4307411 by Chad.Garyet
Merging 4279381 to DevBuild
Fix for UE4Build.cs for Swarm
#jira none
Change 4307794 by Ben.Marsh
UBT: Add a $(TargetOutputDir) variable that can be used in UBT paths and expands to the directory containing the executable. Can be used to ensure DLLs are copied to the appropriate output folder during a build.
Also rename the current $(OutputDir) variable (indicating the binary output directory) to $(BinaryOutputDir) to distinguish between them.
Change 4307912 by Ben.Marsh
Remove the Embree and FBX DLLs that are checked in to Engine/Binaries/Win64, and copy them from the ThirdParty directory as part of the build process instead. This fixes issues where the editor executable is under the project directory rather than the engine directory because it's been built with custom settings (eg. as RoboRecall's editor was).
Change 4307950 by Ben.Marsh
UBT: Add a field to the target receipt which specifies the executable to launch. Allows procedurally determining the location of the editor for a particular target.
Change 4308057 by Ben.Marsh
UGS: Try to read the editor executable path from the target receipt, rather than guessing the executable path directly.
Change 4308651 by Ben.Marsh
UBT: Fix project files not containing include search paths for dependent modules.
#jira UE-62042
Change 4310103 by Ben.Marsh
UGS: Fix exception entering custom server settings when UGS registry key does not exist.
Change 4310109 by Ben.Marsh
UGS: Update launcher version to 1.15.
Change 4310232 by Ben.Marsh
UBT: Catch the case where manifests are recycled if the -NoManifestChanges argument is specified.
Change 4310901 by Ben.Marsh
UBT: Prevent continuing past manifest errors.
Change 4311049 by Ben.Marsh
UBT: Suppress message about change to action history if the previous build product did not exist.
Change 4315494 by Mike.Erwin
Fix backup log timestamps.
When engine starts up, it makes a backup of previous run's log with timestamp appended. Previous code used the current engine startup time; basically recording the time it was backed up, not the time it was generated. This change honors the file's original timestamp. This way files sort properly and we get accurate information about when each log was generated.
#jira none
Change 4318354 by Ben.Marsh
UGS: Add proper support for DPI scaling.
Change 4318356 by Ben.Marsh
UGS: Increase version to 1.153.
Change 4318597 by Ben.Marsh
UGS: Make UGS launcher DPI-aware.
Change 4319205 by Ben.Marsh
UAT: Always use the manifest for determining output files. UBT will initialize it to an empty list of files if the arguments deem it necessary.
Change 4319565 by Ben.Marsh
UAT: Generate the manifest for each compiled target at the same time as exporting its build steps. Prevents module manifests being clobbered due to being overwritten twice.
Change 4320058 by Ben.Marsh
UGS: Prevent "path too long" errors when enumerating files to delete. If the path is invalid, we probably never synced it in the first place, and P4 failed silently.
Change 4320559 by Ben.Marsh
UAT: Fix ParallelExecutor not being used when XGE is not installed, and UBT being run twice for each target.
Change 4322499 by Chad.Garyet
Adding regex to rip the first two p4 path fragments out of a project name to look for wildcard matches in the db
Also actually now allows ability to get ids for specific projects, versus before where all ids were returned for projects that would have matched via wildcard
Pushed to Live 8/28/18
#jira none
Change 4323023 by Ben.Marsh
UBT: Fix cook problems caused by copied runtime dependencies not being added to the receipt or manifest.
#jira UE-63416
Change 4323094 by Ben.Marsh
Add missing dependency on UnrealPak being compiled before building feature packs.
#jira UE-63430
Change 4323330 by Ben.Marsh
Prevent runtime dependencies being copied into installed locations.
#jira UE-63434
Change 4325603 by Ben.Marsh
UBT: Output a message when there is nothing to build for a target (eg. because it's an installed build)
Change 4325607 by Ben.Marsh
UnrealPak: Prevent non-deterministic padding data when compression is disabled.
Change 4328149 by Ben.Marsh
UBT: Fixed issue where MaxProcessorCount and ProcessorCountMultiplier settings would only affect the first class found. These values can now be configured for each executor separately, via the LocalExecutor, ParallelExecutor and SNDBS sections in BuildConfiguration.xml.
Change 4330605 by Ben.Marsh
UGS: When browsing for a project file, always default to the directory containing the current selection.
#jira UE-63474
Change 4333349 by Ben.Marsh
PR #5052: Remove OutputLines = new List<string>(); (Contributed by LizardThief)
Change 4334312 by Ben.Marsh
Update UGS version to 1.154, launcher version to 1.16.
Change 4335790 by Ben.Marsh
UAT: Add a script that checks that the following macro pairs are correctly balanced within every source file in the engine:
* PRAGMA_DISABLE_OPTIMIZATION and PRAGMA_ENABLE_OPTIMIZATION
* PRAGMA_DISABLE_DEPRECATION_WARNINGS and PRAGMA_ENABLE_DEPRECATION_WARNINGS
* THIRD_PARTY_INCLUDES_START and THIRD_PARTY_INCLUDES_END
* PRAGMA_DISABLE_SHADOW_VARIABLE_WARNINGS and PRAGMA_ENABLE_SHADOW_VARIABLE_WARNINGS
* PRAGMA_DISABLE_UNDEFINED_IDENTIFIER_WARNINGS and PRAGMA_ENABLE_UNDEFINED_IDENTIFIER_WARNINGS
* PRAGMA_DISABLE_MISSING_VIRTUAL_DESTRUCTOR_WARNINGS and PRAGMA_ENABLE_MISSING_VIRTUAL_DESTRUCTOR_WARNINGS"
* BEGIN_FUNCTION_BUILD_OPTIMIZATION and END_FUNCTION_BUILD_OPTIMIZATION
* BEGIN_FUNCTION_BUILD_OPTIMIZATION and END_FUNCTION_BUILD_OPTIMIZATION
* BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION and END_SLATE_FUNCTION_BUILD_OPTIMIZATION
Additional projects to scan may be specified with the -Project=<FileName> argument.
Change 4336441 by Ben.Marsh
UGS: Halve P4 update rate (now once every 2m)
Change 4336597 by Ben.Marsh
UAT: Add a command for stashing and unstashing a target. Useful for A/B testing. Example syntax:
Stashing:
RunUAT StashTarget -Name=UE4Editor -To=D:\TempEditor
RunUAT StashTarget -Name=UE4Editor -Platform=Win64 -Configuration=Debug -To=D:\TempEditor
RunUAT StashTarget -Name=ShooterGameEditor -Platform=Win64 -Configuration=Debug -Project=D:\P4\Samples\ShooterGame\ShooterGame.uproject -To=D:\TempEditor
Unstashing:
RunUAT UnstashTarget -From=D:\TempEditor
Change 4301305 by Mike.Erwin
UAT: support multiple Client and Server targets per project.
AutomationTool now accepts values for its -client and -server parameters.
So if you have ClientA.Target.cs and ClientB.Target.cs, run UAT with -client=ClientB to make a build of that variant.
If there is only one target of a particular type (true for all projects up to this point) UAT will detect and use it. If more than target is found, you must specify which one to use. Existing build commands should continue working as before.
Project.Properties.Targets is now a List instead of a Dictionary. RocketSamples.cs is updated here, scripts in other branches might need similar changes. Tested ok in Dev-Core, 4.20, and Fortnite-Main.
#jira UE-60512
Change 4304662 by Ben.Marsh
Always pass an explicit file list into BuildPatchTool when chunking a build. Less prone to errors than filtering files out from a build.
Change 4304874 by Ben.Marsh
UBT: Add an option to produce an error whenever a module manifest is changing, to make it easier to track down issues with files being modified.
Change 4319181 by Ben.Marsh
UAT: Use enum for platform and configuration settings in UE4Build.cs.
#rb none
#ROBOMERGE-OWNER: jason.bestimt
#ROBOMERGE-SOURCE: CL 4336671 in //UE4/Main/...
#ROBOMERGE-BOT: DEVVR (Main -> Dev-VR)
[CL 4336684 by ben marsh in Dev-VR branch]
692 lines
20 KiB
C#
692 lines
20 KiB
C#
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Reflection;
|
|
using UnrealBuildTool;
|
|
using Tools.DotNETCommon;
|
|
|
|
namespace AutomationTool
|
|
{
|
|
/// <summary>
|
|
/// Holds information for targeting specific platform (platform type + cook flavor)
|
|
/// </summary>
|
|
public struct TargetPlatformDescriptor
|
|
{
|
|
public UnrealTargetPlatform Type;
|
|
public string CookFlavor;
|
|
|
|
public TargetPlatformDescriptor(UnrealTargetPlatform InType)
|
|
{
|
|
Type = InType;
|
|
CookFlavor = "";
|
|
}
|
|
public TargetPlatformDescriptor(UnrealTargetPlatform InType, string InCookFlavor)
|
|
{
|
|
Type = InType;
|
|
CookFlavor = InCookFlavor;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return Type.ToString();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Platform abstraction layer.
|
|
/// </summary>
|
|
public class Platform : CommandUtils
|
|
{
|
|
#region Intialization
|
|
|
|
private static Dictionary<TargetPlatformDescriptor, Platform> AllPlatforms = new Dictionary<TargetPlatformDescriptor, Platform>();
|
|
internal static void InitializePlatforms(Assembly[] AssembliesWithPlatforms = null)
|
|
{
|
|
LogVerbose("Creating platforms.");
|
|
|
|
// Create all available platforms.
|
|
foreach (var ScriptAssembly in (AssembliesWithPlatforms != null ? AssembliesWithPlatforms : AppDomain.CurrentDomain.GetAssemblies()))
|
|
{
|
|
CreatePlatformsFromAssembly(ScriptAssembly);
|
|
}
|
|
// Create dummy platforms for platforms we don't support
|
|
foreach (var PlatformType in Enum.GetValues(typeof(UnrealTargetPlatform)))
|
|
{
|
|
var TargetDesc = new TargetPlatformDescriptor((UnrealTargetPlatform)PlatformType);
|
|
Platform ExistingInstance;
|
|
if (AllPlatforms.TryGetValue(TargetDesc, out ExistingInstance) == false)
|
|
{
|
|
LogVerbose("Creating placeholder platform for target: {0}", TargetDesc.Type);
|
|
AllPlatforms.Add(TargetDesc, new Platform(TargetDesc.Type));
|
|
}
|
|
}
|
|
}
|
|
|
|
private static void CreatePlatformsFromAssembly(Assembly ScriptAssembly)
|
|
{
|
|
LogVerbose("Looking for platforms in {0}", ScriptAssembly.Location);
|
|
Type[] AllTypes = null;
|
|
try
|
|
{
|
|
AllTypes = ScriptAssembly.GetTypes();
|
|
}
|
|
catch (Exception Ex)
|
|
{
|
|
LogError("Failed to get assembly types for {0}", ScriptAssembly.Location);
|
|
if (Ex is ReflectionTypeLoadException)
|
|
{
|
|
var TypeLoadException = (ReflectionTypeLoadException)Ex;
|
|
if (!IsNullOrEmpty(TypeLoadException.LoaderExceptions))
|
|
{
|
|
LogError("Loader Exceptions:");
|
|
foreach (var LoaderException in TypeLoadException.LoaderExceptions)
|
|
{
|
|
LogError(LogUtils.FormatException(LoaderException));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
LogError("No Loader Exceptions available.");
|
|
}
|
|
}
|
|
// Re-throw, this is still a critical error!
|
|
throw Ex;
|
|
}
|
|
foreach (var PotentialPlatformType in AllTypes)
|
|
{
|
|
if (PotentialPlatformType != typeof(Platform) && typeof(Platform).IsAssignableFrom(PotentialPlatformType) && !PotentialPlatformType.IsAbstract)
|
|
{
|
|
LogVerbose("Creating platform {0} from {1}.", PotentialPlatformType.Name, ScriptAssembly.Location);
|
|
var PlatformInstance = Activator.CreateInstance(PotentialPlatformType) as Platform;
|
|
var PlatformDesc = PlatformInstance.GetTargetPlatformDescriptor();
|
|
|
|
Platform ExistingInstance;
|
|
if (!AllPlatforms.TryGetValue(PlatformDesc, out ExistingInstance))
|
|
{
|
|
AllPlatforms.Add(PlatformDesc, PlatformInstance);
|
|
}
|
|
else
|
|
{
|
|
LogWarning("Platform {0} already exists", PotentialPlatformType.Name);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
protected UnrealTargetPlatform TargetPlatformType = UnrealTargetPlatform.Unknown;
|
|
protected UnrealTargetPlatform TargetIniPlatformType = UnrealTargetPlatform.Unknown;
|
|
|
|
public Platform(UnrealTargetPlatform PlatformType)
|
|
{
|
|
TargetPlatformType = PlatformType;
|
|
TargetIniPlatformType = PlatformType;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Allow the platform to alter the ProjectParams
|
|
/// </summary>
|
|
/// <param name="ProjParams"></param>
|
|
public virtual void PlatformSetupParams(ref ProjectParams ProjParams)
|
|
{
|
|
|
|
}
|
|
|
|
public virtual TargetPlatformDescriptor GetTargetPlatformDescriptor()
|
|
{
|
|
return new TargetPlatformDescriptor(TargetPlatformType, "");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Package files for the current platform.
|
|
/// </summary>
|
|
/// <param name="ProjectPath"></param>
|
|
/// <param name="ProjectExeFilename"></param>
|
|
public virtual void Package(ProjectParams Params, DeploymentContext SC, int WorkingCL)
|
|
{
|
|
throw new AutomationException("{0} does not yet implement Packaging.", PlatformType);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Does the reverse of the output from the package process
|
|
/// </summary>
|
|
/// <param name="SourcePath"></param>
|
|
/// <param name="DestinationPath"></param>
|
|
public virtual void ExtractPackage(ProjectParams Params, string SourcePath, string DestinationPath)
|
|
{
|
|
throw new AutomationException("{0} does not yet implement ExtractPackage.", PlatformType);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Allow platform to do platform specific work on archived project before it's deployed.
|
|
/// </summary>
|
|
/// <param name="Params"></param>
|
|
/// <param name="SC"></param>
|
|
public virtual void ProcessArchivedProject(ProjectParams Params, DeploymentContext SC)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get all connected device names for this platform
|
|
/// </summary>
|
|
/// <param name="Params"></param>
|
|
/// <param name="SC"></param>
|
|
public virtual void GetConnectedDevices(ProjectParams Params, out List<string> Devices)
|
|
{
|
|
Devices = null;
|
|
LogWarning("{0} does not implement GetConnectedDevices", PlatformType);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Allow platform specific work prior to touching the staging directory
|
|
/// </summary>
|
|
/// <param name="Params"></param>
|
|
/// <param name="SC"></param>
|
|
public virtual void PreStage(ProjectParams Params, DeploymentContext SC)
|
|
{
|
|
// do nothing on most platforms
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Deploy the application on the current platform
|
|
/// </summary>
|
|
/// <param name="Params"></param>
|
|
/// <param name="SC"></param>
|
|
public virtual void Deploy(ProjectParams Params, DeploymentContext SC)
|
|
{
|
|
LogWarning("{0} does not implement Deploy...", PlatformType);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Run the client application on the platform
|
|
/// </summary>
|
|
/// <param name="ClientRunFlags"></param>
|
|
/// <param name="ClientApp"></param>
|
|
/// <param name="ClientCmdLine"></param>
|
|
public virtual IProcessResult RunClient(ERunOptions ClientRunFlags, string ClientApp, string ClientCmdLine, ProjectParams Params)
|
|
{
|
|
PushDir(Path.GetDirectoryName(ClientApp));
|
|
// Always start client process and don't wait for exit.
|
|
IProcessResult ClientProcess = Run(ClientApp, ClientCmdLine, null, ClientRunFlags | ERunOptions.NoWaitForExit);
|
|
PopDir();
|
|
|
|
return ClientProcess;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Downloads file from target device to local pc
|
|
/// </summary>
|
|
/// <param name="RemoteFilePath"></param>
|
|
/// <param name="LocalFile"></param>
|
|
/// <param name="Params"></param>
|
|
public virtual void GetTargetFile(string RemoteFilePath, string LocalFile, ProjectParams Params)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Allow platform specific clean-up or detection after client has run
|
|
/// </summary>
|
|
/// <param name="ClientRunFlags"></param>
|
|
public virtual void PostRunClient(IProcessResult Result, ProjectParams Params)
|
|
{
|
|
// do nothing in the default case
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get the platform-specific name for the executable (with out the file extension)
|
|
/// </summary>
|
|
/// <param name="InExecutableName"></param>
|
|
/// <returns></returns>
|
|
public virtual string GetPlatformExecutableName(string InExecutableName)
|
|
{
|
|
return InExecutableName;
|
|
}
|
|
|
|
public virtual List<FileReference> GetExecutableNames(DeploymentContext SC)
|
|
{
|
|
List<FileReference> ExecutableNames = new List<FileReference>();
|
|
foreach (StageTarget Target in SC.StageTargets)
|
|
{
|
|
foreach (BuildProduct Product in Target.Receipt.BuildProducts)
|
|
{
|
|
if (Product.Type == BuildProductType.Executable)
|
|
{
|
|
FileReference BuildProductFile = Product.Path;
|
|
if (BuildProductFile.IsUnderDirectory(SC.ProjectRoot))
|
|
{
|
|
ExecutableNames.Add(FileReference.Combine(SC.RuntimeProjectRootDir, BuildProductFile.MakeRelativeTo(SC.ProjectRoot)));
|
|
}
|
|
else
|
|
{
|
|
ExecutableNames.Add(FileReference.Combine(SC.RuntimeRootDir, BuildProductFile.MakeRelativeTo(RootDirectory)));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return ExecutableNames;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get the files to deploy, specific to this platform, typically binaries
|
|
/// </summary>
|
|
/// <param name="SC">Deployment Context</param>
|
|
public virtual void GetFilesToDeployOrStage(ProjectParams Params, DeploymentContext SC)
|
|
{
|
|
throw new AutomationException("{0} does not yet implement GetFilesToDeployOrStage.", PlatformType);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Called after CopyUsingStagingManifest. Does anything platform specific that requires a final list of staged files.
|
|
/// e.g. PlayGo emulation control file generation for PS4.
|
|
/// </summary>
|
|
/// <param name="Params"></param>
|
|
/// <param name="SC"></param>
|
|
public virtual void PostStagingFileCopy(ProjectParams Params, DeploymentContext SC)
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get the files to deploy, specific to this platform, typically binaries
|
|
/// </summary>
|
|
/// <param name="SC">Deployment Context</param>
|
|
public virtual void GetFilesToArchive(ProjectParams Params, DeploymentContext SC)
|
|
{
|
|
SC.ArchiveFiles(SC.StageDirectory.FullName);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets cook platform name for this platform.
|
|
/// </summary>
|
|
/// <param name="bDedicatedServer">True if cooking for dedicated server</param>
|
|
/// <param name="bIsClientOnly">True if cooking for client only</param>
|
|
/// <returns>Cook platform string.</returns>
|
|
public virtual string GetCookPlatform(bool bDedicatedServer, bool bIsClientOnly)
|
|
{
|
|
throw new AutomationException("{0} does not yet implement GetCookPlatform.", PlatformType);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets extra cook commandline arguments for this platform.
|
|
/// </summary>
|
|
/// <param name="Params"> ProjectParams </param>
|
|
/// <returns>Cook platform string.</returns>
|
|
public virtual string GetCookExtraCommandLine(ProjectParams Params)
|
|
{
|
|
return "";
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets extra maps needed on this platform.
|
|
/// </summary>
|
|
/// <returns>extra maps</returns>
|
|
public virtual List<string> GetCookExtraMaps()
|
|
{
|
|
return new List<string>();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get a release pak file path, if we are currently building a patch then get the previous release pak file path, if we are creating a new release this will be the output path
|
|
/// </summary>
|
|
/// <param name="SC"></param>
|
|
/// <param name="Params"></param>
|
|
/// <param name="PakName"></param>
|
|
/// <returns></returns>
|
|
public virtual string GetReleasePakFilePath(DeploymentContext SC, ProjectParams Params, string PakName)
|
|
{
|
|
if (Params.IsGeneratingPatch)
|
|
{
|
|
return CombinePaths(Params.GetBasedOnReleaseVersionPath(SC, Params.Client), PakName);
|
|
}
|
|
else
|
|
{
|
|
return CombinePaths(Params.GetCreateReleaseVersionPath(SC, Params.Client), PakName);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets editor cook platform name for this platform. Cooking the editor is not useful, but this is used to fill the derived data cache
|
|
/// </summary>
|
|
/// <returns>Cook platform string.</returns>
|
|
public virtual string GetEditorCookPlatform()
|
|
{
|
|
return GetCookPlatform(false, false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// return true if we need to change the case of filenames outside of pak files
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public virtual bool DeployLowerCaseFilenames()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Converts local path to target platform path.
|
|
/// </summary>
|
|
/// <param name="LocalPath">Local path.</param>
|
|
/// <param name="LocalRoot">Local root.</param>
|
|
/// <returns>Local path converted to device format path.</returns>
|
|
public virtual string LocalPathToTargetPath(string LocalPath, string LocalRoot)
|
|
{
|
|
return LocalPath;
|
|
}
|
|
/// <summary>
|
|
/// Returns a list of the compiler produced debug file extensions
|
|
/// </summary>
|
|
/// <returns>a list of the compiler produced debug file extensions</returns>
|
|
public virtual List<string> GetDebugFileExtensions()
|
|
{
|
|
return new List<string>();
|
|
}
|
|
|
|
/// <summary>
|
|
/// UnrealTargetPlatform type for this platform.
|
|
/// </summary>
|
|
public UnrealTargetPlatform PlatformType
|
|
{
|
|
get { return TargetPlatformType; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// UnrealTargetPlatform type for this platform.
|
|
/// </summary>
|
|
public UnrealTargetPlatform IniPlatformType
|
|
{
|
|
get { return TargetIniPlatformType; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// True if this platform is supported.
|
|
/// </summary>
|
|
public virtual bool IsSupported
|
|
{
|
|
get { return false; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// True if this platform requires UFE for deploying
|
|
/// </summary>
|
|
public virtual bool DeployViaUFE
|
|
{
|
|
get { return false; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// True if this platform requires UFE for launching
|
|
/// </summary>
|
|
public virtual bool LaunchViaUFE
|
|
{
|
|
get { return false; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// True if this platform can write to the abslog path that's on the host desktop.
|
|
/// </summary>
|
|
public virtual bool UseAbsLog
|
|
{
|
|
get { return BuildHostPlatform.Current.Platform == PlatformType; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Remaps the given content directory to its final location
|
|
/// </summary>
|
|
public virtual StagedFileReference Remap(StagedFileReference Dest)
|
|
{
|
|
return Dest;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tri-state - The intent is to override command line parameters for pak if needed per platform.
|
|
/// </summary>
|
|
///
|
|
public enum PakType { Always, Never, DontCare };
|
|
|
|
public virtual PakType RequiresPak(ProjectParams Params)
|
|
{
|
|
return PakType.DontCare;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns platform specific command line options for UnrealPak
|
|
/// </summary>
|
|
public virtual string GetPlatformPakCommandLine(ProjectParams Params, DeploymentContext SC)
|
|
{
|
|
return "";
|
|
}
|
|
|
|
/// <summary>
|
|
/// True if this platform is supported.
|
|
/// </summary>
|
|
public virtual bool SupportsMultiDeviceDeploy
|
|
{
|
|
get { return false; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns true if the platform wants patches to generate a small .pak file containing the difference
|
|
/// of current data against a shipped pak file.
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public virtual bool GetPlatformPatchesWithDiffPak(ProjectParams Params, DeploymentContext SC)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns whether the platform requires a package to deploy to a device
|
|
/// </summary>
|
|
public virtual bool RequiresPackageToDeploy
|
|
{
|
|
get { return false; }
|
|
}
|
|
|
|
public virtual HashSet<StagedFileReference> GetFilesForCRCCheck()
|
|
{
|
|
string CmdLine = "UE4CommandLine.txt";
|
|
if (DeployLowerCaseFilenames())
|
|
{
|
|
CmdLine = CmdLine.ToLowerInvariant();
|
|
}
|
|
return new HashSet<StagedFileReference>() { new StagedFileReference(CmdLine) };
|
|
}
|
|
|
|
public virtual void StripSymbols(FileReference SourceFile, FileReference TargetFile)
|
|
{
|
|
if (SourceFile == TargetFile)
|
|
{
|
|
CommandUtils.LogWarning("StripSymbols() has not been implemented for {0}", PlatformType.ToString());
|
|
}
|
|
else
|
|
{
|
|
CommandUtils.LogWarning("StripSymbols() has not been implemented for {0}; copying files", PlatformType.ToString());
|
|
File.Copy(SourceFile.FullName, TargetFile.FullName, true);
|
|
}
|
|
}
|
|
|
|
public virtual bool PublishSymbols(DirectoryReference SymbolStoreDirectory, List<FileReference> Files, string Product)
|
|
{
|
|
CommandUtils.LogWarning("PublishSymbols() has not been implemented for {0}", PlatformType.ToString());
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// When overridden, returns the directory structure of the platform's symbol server.
|
|
/// Each element is a semi-colon separated string of possible directory names.
|
|
/// The * wildcard is allowed in any entry. {0} will be substituted for a custom filter string.
|
|
/// </summary>
|
|
public virtual string[] SymbolServerDirectoryStructure
|
|
{
|
|
get { return null; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// If true, indicates the platform's symbol server directory must be locked for
|
|
/// exclusive access before any operation is performed on it. Platforms may override
|
|
/// this to disable if their tools support concurrent access to the symbol server directory.
|
|
/// </summary>
|
|
public virtual bool SymbolServerRequiresLock
|
|
{
|
|
get { return true; }
|
|
}
|
|
|
|
#region Hooks
|
|
|
|
public virtual void PreBuildAgenda(UE4Build Build, UE4Build.BuildAgenda Agenda)
|
|
{
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
/// General purpose command to run generic string commands inside the platform interfeace
|
|
/// </summary>
|
|
/// <param name="Command"></param>
|
|
public virtual int RunCommand(string Command)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Determines whether we should stage a UE4CommandLine.txt for this platform
|
|
/// </summary>
|
|
public virtual bool ShouldStageCommandLine(ProjectParams Params, DeploymentContext SC)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Only relevant for the mac and PC at the moment. Example calling the Mac platform with PS4 as an arg will return false. Can't compile or cook for the PS4 on the mac.
|
|
/// </summary>
|
|
public virtual bool CanHostPlatform(UnrealTargetPlatform Platform)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Allows some platforms to not be compiled, for instance when BuildCookRun -build is performed
|
|
/// </summary>
|
|
/// <returns><c>true</c> if this instance can be compiled; otherwise, <c>false</c>.</returns>
|
|
public virtual bool CanBeCompiled()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public virtual bool RetrieveDeployedManifests(ProjectParams Params, DeploymentContext SC, string DeviceName, out List<string> UFSManifests, out List<string> NonUFSManifests)
|
|
{
|
|
UFSManifests = null;
|
|
NonUFSManifests = null;
|
|
return false;
|
|
}
|
|
|
|
public virtual bool SignExecutables(DeploymentContext SC, ProjectParams Params)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public virtual UnrealTargetPlatform[] GetStagePlatforms()
|
|
{
|
|
return new UnrealTargetPlatform[] { PlatformType };
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Utilities
|
|
|
|
// let the platform set the exe extension if it chooses (otherwise, use
|
|
// the switch statement in GetExeExtension below)
|
|
protected virtual string GetPlatformExeExtension()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public static string GetExeExtension(UnrealTargetPlatform Target)
|
|
{
|
|
Platform Plat = GetPlatform(Target);
|
|
string PlatformExeExtension = Plat.GetPlatformExeExtension();
|
|
if (!string.IsNullOrEmpty(PlatformExeExtension))
|
|
{
|
|
return PlatformExeExtension;
|
|
}
|
|
|
|
switch (Target)
|
|
{
|
|
case UnrealTargetPlatform.Win32:
|
|
case UnrealTargetPlatform.Win64:
|
|
case UnrealTargetPlatform.XboxOne:
|
|
return ".exe";
|
|
case UnrealTargetPlatform.PS4:
|
|
return ".self";
|
|
case UnrealTargetPlatform.IOS:
|
|
return ".stub";
|
|
case UnrealTargetPlatform.Linux:
|
|
return "";
|
|
case UnrealTargetPlatform.HTML5:
|
|
return ".js";
|
|
case UnrealTargetPlatform.Mac:
|
|
return ".app";
|
|
}
|
|
|
|
return String.Empty;
|
|
}
|
|
|
|
public static Dictionary<TargetPlatformDescriptor, Platform> Platforms
|
|
{
|
|
get { return AllPlatforms; }
|
|
}
|
|
|
|
public static Platform GetPlatform(UnrealTargetPlatform PlatformType)
|
|
{
|
|
TargetPlatformDescriptor Desc = new TargetPlatformDescriptor(PlatformType);
|
|
return AllPlatforms[Desc];
|
|
}
|
|
|
|
public static Platform GetPlatform(UnrealTargetPlatform PlatformType, string CookFlavor)
|
|
{
|
|
TargetPlatformDescriptor Desc = new TargetPlatformDescriptor(PlatformType, CookFlavor);
|
|
return AllPlatforms[Desc];
|
|
}
|
|
|
|
public static bool IsValidTargetPlatform(TargetPlatformDescriptor PlatformDesc)
|
|
{
|
|
return AllPlatforms.ContainsKey(PlatformDesc);
|
|
}
|
|
|
|
public static List<TargetPlatformDescriptor> GetValidTargetPlatforms(UnrealTargetPlatform PlatformType, List<string> CookFlavors)
|
|
{
|
|
List<TargetPlatformDescriptor> ValidPlatforms = new List<TargetPlatformDescriptor>();
|
|
if (!CommandUtils.IsNullOrEmpty(CookFlavors))
|
|
{
|
|
foreach (string CookFlavor in CookFlavors)
|
|
{
|
|
TargetPlatformDescriptor TargetDesc = new TargetPlatformDescriptor(PlatformType, CookFlavor);
|
|
if (IsValidTargetPlatform(TargetDesc))
|
|
{
|
|
ValidPlatforms.Add(TargetDesc);
|
|
}
|
|
}
|
|
}
|
|
|
|
// In case there are no flavors specified or this platform type does not care/support flavors add it as generic platform
|
|
if (ValidPlatforms.Count == 0)
|
|
{
|
|
TargetPlatformDescriptor TargetDesc = new TargetPlatformDescriptor(PlatformType);
|
|
if (IsValidTargetPlatform(TargetDesc))
|
|
{
|
|
ValidPlatforms.Add(TargetDesc);
|
|
}
|
|
}
|
|
|
|
return ValidPlatforms;
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|