You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb none #lockdown Nick.Penwarden ========================== MAJOR FEATURES + CHANGES ========================== Change 3345860 on 2017/03/14 by Daniel.Lamb Fixed crash when building DLC #test Cook paragon. Change 3347324 on 2017/03/15 by Gil.Gribb UE4 - Removed old code relating to FAsyncArchive, FAsyncIOSubsystemBase and package level compression. The editor now uses the lowest levels on the new async IO scheme. Change 3347331 on 2017/03/15 by Robert.Manuszewski Fix for a crash caused by GC killing BP class (due to no strong references) but its CDO is being kept alive because it was in the same cluster as the class and was not marked as pending kill. #jira UE-42732 Change 3347371 on 2017/03/15 by Graeme.Thornton Fix for runtime asset cache not invalidating files with an outdated version number Change 3349161 on 2017/03/16 by Steve.Robb Generated UFUNCTION FNames no longer exported. Misc refactors of code generation. Change 3349167 on 2017/03/16 by Steve.Robb Unused TBoolConstant removed (the more general TIntegralConstant should be used instead). Change 3349274 on 2017/03/16 by Gil.Gribb UE4 - Fix loading a package that is already loaded. Change 3349534 on 2017/03/16 by Ben.Marsh UBT: Check that the SN-DBS service is running before attempting to use it. Change 3349612 on 2017/03/16 by Gil.Gribb UE4 - Increased estimate of summary size. Change 3350021 on 2017/03/16 by Gil.Gribb UE4 - Fixed crash in signature checks when mounting pak files. Change 3350052 on 2017/03/16 by Ben.Marsh Remove invalid characters from macro names before passing as macro values. Prevents compile errors for projects which have apostrophes in the name. Change 3350360 on 2017/03/16 by Ben.Marsh UAT: Fix non-threadsafe access of ExeToTimeInMs when spawning external processes. Change 3351670 on 2017/03/17 by Ben.Marsh UBT: Ignore all default libraries when creating import libs. Sometimes #pragma comment(lib, ...) directives can add force additional libraries onto the linker/librarian command line. We don't want or need these included when generating import libraries, but they can cause errors due to search paths not being able to find them. Change 3352289 on 2017/03/17 by Ben.Marsh Fix issues working with > 2GB archives caused by truncation of the return value from FArchive::Tell() down to 32-bits. Change 3352390 on 2017/03/17 by Ben.Marsh Remove unused/out of date binaries for CrashReporter. Change 3352392 on 2017/03/17 by Ben.Marsh Remove UnrealDocTool binaries. This is distributed through a Visual Studio plugin now. Change 3352410 on 2017/03/17 by Ben.Marsh Remove P4ChangeReporter. I don't believe this is used any more. Change 3352450 on 2017/03/17 by Ben.Marsh Disable including CrashReporter by default when packaging projects. This is only useful with a CrashReporter backend set up, which only usually applies to Epic internal projects. Change 3352455 on 2017/03/17 by Ben.Marsh Remove RegisterPII and TranslatedWordsCountEstimator executables. Don't believe these are used any more. Change 3352940 on 2017/03/17 by Wes.Hunt Update CRP to not send Slack queue size updates unless the waiting time is greater than 1 minute. #codereview: jin.zhang Change 3353658 on 2017/03/20 by Steve.Robb Fix for crash when importing a BP which has a populated TMap with an enum class key. Change 3354056 on 2017/03/20 by Steve.Robb TAssetPtr<T> can now be constructed from a nullptr without a full definition of T. Change 3356111 on 2017/03/21 by Graeme.Thornton Fix for UE-34131 - Support double and fname stat types in UFE stat export to CSV #jira UE-34131 Change 3358584 on 2017/03/22 by Daniel.Lamb Fixed the garbage collection keep flags when cleaning the sandbox for iterative cooking. #test Cook shootergame Change 3360379 on 2017/03/23 by Gil.Gribb UE4 - Avoid adding a linker annotation if it actually hasn't changed. Improves ConditionalBeginDestroy performance. Change 3360623 on 2017/03/23 by Gil.Gribb UE4 - Change from MarcA to avoid a redudnant removal of PrimitiveComponent from the streaming managers during ConditionalBeginDestroy. Change 3360627 on 2017/03/23 by Gil.Gribb UE4 - Optimized UObject hash tables for speed and space. Change 3361183 on 2017/03/23 by Gil.Gribb UE4 - Fixed change to NotifyPrimitiveDetached so that it works in the editor. Change 3361906 on 2017/03/23 by Steve.Robb Fix for a bad hint index when instantiating map property subobjects when the defaults has fewer but non-zero elements. #jira UE-43272 Change 3362839 on 2017/03/24 by Gil.Gribb UE4 - Fixed hash table lock optimization. Change 3367348 on 2017/03/28 by Robert.Manuszewski Making sure streamed-in SoundWaves get added to GC clusters. Change 3367386 on 2017/03/28 by Ben.Marsh EC: Pass the Semaphores property from a build type as a parameter to new build jobs. Change 3367422 on 2017/03/28 by Ben.Marsh EC: Allow limiting the number of scheduled jobs that will be automatically run at a particular time. Each build type can have a 'Semaphores' property in the branch settings file, which will be copied to newly created jobs. Before scheduling new jobs, EC is queried for the 'Semaphores' property on any running jobs, and build types with existing semaphores will be skipped. Does not prevent jobs from being run manually. Change 3367469 on 2017/03/28 by Ben.Marsh EC: Prevent multiple incremental jobs running at once. Change 3367640 on 2017/03/28 by Ben.Marsh Plugins: Add an optional EngineVersion field back into the plugin descriptor. If set, the engine will warn if the plugin is not compatible with the current engine version. Plugins will set this field by default when packaging; pass -Unversioned to override. Change 3367836 on 2017/03/28 by Uriel.Doyon Improved handled of references in the streaming manager Change 3369354 on 2017/03/29 by Graeme.Thornton Added AES encrypt/decrypt functions that take a byte array for the key Change 3369804 on 2017/03/29 by Ben.Marsh Remove incorrect "EngineVersion" settings from plugin descriptors. Change 3370462 on 2017/03/29 by Ben.Marsh Editor: Install Visual Studio 2017 by default, instead of Visual Studio 2015. Changed to use ExecElevatedProcess() to prevent installer failing to run if the current user is not already an administrator. #jira UE-43467 Change 3371598 on 2017/03/30 by Ben.Marsh UBT: Fix message for missing toolchain in VS2017. Change 3372827 on 2017/03/30 by Ben.Marsh BuildGraph: Output an error at the end of each step if any previous build products have been modified. Change 3372947 on 2017/03/30 by Ben.Marsh [Merge] Always add the host editor platform as supported in an installed build. Not doing so prevents the build platform being registered in UBT, which prevents doing any platform-specific staging operations in UAT. Change 3372958 on 2017/03/30 by Ben.Marsh [Merge] Simplify log output for cooks. Suppress additional timestamps from the editor when running through UAT. Change 3372981 on 2017/03/30 by Ben.Marsh [Merge] Modular game fixes for UAT * Store list of executable names from the receipts instead of generating them from Target/Platform/Config/Architecture combination * Get full list of staged executables from receipts instead of assuming only non-code projects are in Engine * Always pass short project name as Bootstrap argument, so that modular game exe knows which project to start Change 3373024 on 2017/03/30 by Ben.Marsh [Merge] Add an option to UAT (-CookOutputDir=...) and the cooker (-OutputDir=...) which allows overriding the output directory for cooked files, and fix situations where the directory becomes too deep. Change 3373041 on 2017/03/30 by Ben.Marsh [Merge] Added UAT script to replace assets with another source Renamed ReplaceAssetsCommandlet to GenerateAssetsManifest as it now outputs a list of files and has nothing specific about replacing files Change 3373052 on 2017/03/30 by Ben.Marsh [Merge] Changed CopyUsingDistillFileSet command so that it can use a pre-existing manifest file instead of running commandlet Change 3373092 on 2017/03/30 by Ben.Marsh [Merge] Fixed crash attempting to load cooked static mesh in editor Change 3373112 on 2017/03/30 by Ben.Marsh [Merge] Fixed crash caused by loading cooked StaticMesh in editor that didn't have any SourceModels Change 3373132 on 2017/03/30 by Ben.Marsh [Merge] Added Additional Maps that are always cooked to the GenerateDistillFileSetsCommandlet Change 3373138 on 2017/03/30 by Ben.Marsh [Merge] Fixed code issue with playback of cooked SoundCues Skip over code using editor only data when editor data has been stripped Change 3373143 on 2017/03/30 by Ben.Marsh [Merge] Fixed crash when attempting to open multiple cooked assets Change 3373156 on 2017/03/30 by Ben.Marsh [Merge] Added commandlet to replace game assets with those from another source (intended for cooked asset replacement) Change 3373161 on 2017/03/30 by Ben.Marsh [Merge] Prevented crash by not attempting to Load Mips again if a package has cooked data Change 3373168 on 2017/03/30 by Ben.Marsh [Merge] Fix output path for DLC pak file, so it can be discovered by the engine and automatically mounted (and to stop it colliding with the main game pak file). Change 3373204 on 2017/03/30 by Ben.Marsh [Merge] Fix crash when switching levels in PIE, due to bulk data already having been discarded for cooked assets. Cooking sets BULKDATA_SingleUse for textures, but PIEing needs to keep bulk data around. Change 3373209 on 2017/03/30 by Ben.Marsh [Merge] Fix missing material in mod editor for cooked assets. Change 3373388 on 2017/03/30 by Ben.Marsh [Merge] Various improvements to the plugin browser and new plugin wizard from Robo Recall. Change 3374200 on 2017/03/31 by Ben.Marsh [Merge] Latest OdinEditor plugin from //Odin/Main, to fix build failures. Re-made change to OdinUnrealEdEngine to remove dependencies on analytics. Change 3374279 on 2017/03/31 by Ben.Marsh PR #3441: Invalid JSON in FeaturePacks (Contributed by projectgheist) Change 3374331 on 2017/03/31 by Ben.Marsh UBT: Disable warning pragmas on Mono; not supported on current compiler. #jira UE-43451 Change 3375108 on 2017/03/31 by Ben.Marsh Removing another plugin EngineVersion property. Change 3375126 on 2017/03/31 by Ben.Marsh Fix incorrect executable paths being generated for Windows. Change 3375159 on 2017/03/31 by Graeme.Thornton Pak Index Encryption - Added "-encryptindex" option to unrealpak which will encrypt the pak index, making the pak file unreadable without the associated decryption key - Added "-encryptpakindex" option to UAT to force on index encryption - Added "bEncryptPakIndex" setting to project packaging settings so pak encryption can be controlled via the editor Change 3375197 on 2017/03/31 by Graeme.Thornton Enable pak index encryption in shootergame Change 3375377 on 2017/03/31 by Ben.Marsh Add build node to submit updated UnrealPak binaries for Win64, Mac and Linux. Currently has to be run via a custom build on EC, with the target set to "Submit UnrealPak Binaries". Change 3376418 on 2017/04/03 by Ben.Marsh BuildGraph: Always clear the cached node state when running locally without having to manually specify the -ClearHistory argument. The -Resume argument allows the previous behavior of continuing a previous build. Change 3376447 on 2017/04/03 by Ben.Marsh Build: Remove some unused stream settings Change 3376469 on 2017/04/03 by Ben.Marsh Build: Add a customizable field for the script to use for custom builds in every branch. Change 3376654 on 2017/04/03 by Ben.Marsh Add a fatal error message containing the module with an outstanding reference when trying to unload it. #jira UE-42423 Change 3376747 on 2017/04/03 by Gil.Gribb UE4 - Fixed crash relating to FGenericAsyncReadFileHandle when not using the EDL. Change 3377173 on 2017/04/03 by Ben.Marsh Make sure callstacks are written to stdout following a crash on a background thread. Change 3377183 on 2017/04/03 by Ben.Marsh Removing support for building VS2013 targets. Ability to generate VS2013 project files is still allowed, but unsupported (via the -2013unsupported command line argument). Change 3377280 on 2017/04/03 by Ben.Marsh Build: Post UGS badges for all UE4 development streams, with the project set to $(Branch)/... Change3377311on 2017/04/03 by Ben.Marsh Build: Set the 'Semaphores' parameter for any jobs started from a schedule. Change 3377326 on 2017/04/03 by Ben.Marsh UGS: Show badges which match an entire subtree if the project field ends with "...". Change 3377392 on 2017/04/03 by Ben.Marsh Add badges to UE4/Main and UE4/Release streams, and change the names of the builds in development streams to distinguish them. Change 3377895 on 2017/04/03 by Ben.Marsh EC: Send notification emails whenever UAT fails to compile. Change 3377923 on 2017/04/03 by Ben.Marsh Build: Use a different semaphore for the common editors build target to the incremental compile build target. Change 3378297 on 2017/04/04 by Graeme.Thornton Fix incorrect generation of UE_ENGINE_DIRECTORY in UBT Change 3378301 on 2017/04/04 by Ben.Marsh UBT: Try enabling bAdaptiveUnityDisablesPCH by default, to reduce the number of build failures we see due to missing includes. Change 3378460 on 2017/04/04 by Graeme.Thornton Remove dependency preloading system from sync and async loading paths Change 3378535 on 2017/04/04 by Robert.Manuszewski Fix for audio crash when launching Ocean PIE after removing the audio chunk allocation in CL #3347324 #jira UE-43544 Change 3378575 on 2017/04/04 by Robert.Manuszewski Making sure actor clusters are not created in non-cooked builds #jira UE-43617 #jira UE-43614 Change 3378589 on 2017/04/04 by Robert.Manuszewski Disabling debug GC cluster logging #jira UE-43617 Change 3379118 on 2017/04/04 by Robert.Manuszewski Disabling actor clustering by default, keeping it on in Orion and Ocean Change 3379815 on 2017/04/04 by Ben.Marsh Revert change to derive executable names from target receipts. While a better solution than making them up, Android relies on having the base executable names for supporting multiple architectures. Change 3380811 on 2017/04/05 by Gil.Gribb UE4 - Put the special boot order things into baseengine.ini so that licensees and games can add to it. Change 3383313 on 2017/04/06 by Uriel.Doyon Integrated CL 3372436 33727653373272from Dev-Rendering #JIRA UE-43669 Change 3383531 on 2017/04/06 by Ben.Marsh UGS: Ignore failures when querying whether paths exist. Permissions can cause this folder to fail, even if it will succeed at a parent directory. Change 3383786 on 2017/04/06 by Ben.Zeigler Back out changelist 3382694 and replace with CL #3383757 from bob.tellez: Fix memory stomping issue caused by removing a FFortProfileSynchronizeRequest from SynchronizeRequests in UFortRegisteredPlayerInfo::UpdateSynchronizeRequest before SynchronizeProfile had finished executing Change 3385089 on 2017/04/07 by Gil.Gribb UE4 - Critical. Fixed memory leak in pak precacher. [CL 3386123 by Ben Marsh in Main branch]
723 lines
23 KiB
C#
723 lines
23 KiB
C#
// Copyright 1998-2017 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;
|
|
|
|
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>
|
|
/// 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>
|
|
/// 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<string> GetExecutableNames(DeploymentContext SC, bool bIsRun = false)
|
|
{
|
|
var ExecutableNames = new List<String>();
|
|
string Ext = AutomationTool.Platform.GetExeExtension(SC.StageTargetPlatform.TargetPlatformType);
|
|
if (!String.IsNullOrEmpty(SC.CookPlatform))
|
|
{
|
|
if (SC.StageTargets.Count() > 0)
|
|
{
|
|
DirectoryReference LocalRoot = new DirectoryReference(SC.LocalRoot);
|
|
foreach (StageTarget Target in SC.StageTargets)
|
|
{
|
|
foreach (BuildProduct Product in Target.Receipt.BuildProducts)
|
|
{
|
|
if (Product.Type == BuildProductType.Executable)
|
|
{
|
|
string RelativeExePath = new FileReference(Product.Path).MakeRelativeTo(LocalRoot);
|
|
ExecutableNames.Add(Path.Combine(SC.RuntimeRootDir, RelativeExePath));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//@todo, probably the rest of this can go away once everything passes it through
|
|
else if (SC.DedicatedServer)
|
|
{
|
|
if (!SC.IsCodeBasedProject)
|
|
{
|
|
string ExeName = SC.StageTargetPlatform.GetPlatformExecutableName("UE4Server");
|
|
ExecutableNames.Add(CombinePaths(SC.RuntimeRootDir, "Engine/Binaries", SC.PlatformDir, ExeName + Ext));
|
|
}
|
|
else
|
|
{
|
|
string ExeName = SC.StageTargetPlatform.GetPlatformExecutableName(SC.ShortProjectName + "Server");
|
|
string ClientApp = CombinePaths(SC.RuntimeProjectRootDir, "Binaries", SC.PlatformDir, ExeName + Ext);
|
|
var TestApp = CombinePaths(SC.ProjectRoot, "Binaries", SC.PlatformDir, SC.ShortProjectName + "Server" + Ext);
|
|
string Game = "Game";
|
|
//@todo, this is sketchy, someone might ask what the exe is before it is compiled
|
|
if (!FileExists_NoExceptions(ClientApp) && !FileExists_NoExceptions(TestApp) && SC.ShortProjectName.EndsWith(Game, StringComparison.InvariantCultureIgnoreCase))
|
|
{
|
|
ExeName = SC.StageTargetPlatform.GetPlatformExecutableName(SC.ShortProjectName.Substring(0, SC.ShortProjectName.Length - Game.Length) + "Server");
|
|
ClientApp = CombinePaths(SC.RuntimeProjectRootDir, "Binaries", SC.PlatformDir, ExeName + Ext);
|
|
}
|
|
ExecutableNames.Add(ClientApp);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (!SC.IsCodeBasedProject)
|
|
{
|
|
string ExeName = SC.StageTargetPlatform.GetPlatformExecutableName("UE4Game");
|
|
ExecutableNames.Add(CombinePaths(SC.RuntimeRootDir, "Engine/Binaries", SC.PlatformDir, ExeName + Ext));
|
|
}
|
|
else
|
|
{
|
|
string ExeName = SC.StageTargetPlatform.GetPlatformExecutableName(SC.ShortProjectName);
|
|
ExecutableNames.Add(CombinePaths(SC.RuntimeProjectRootDir, "Binaries", SC.PlatformDir, ExeName + Ext));
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
string ExeName = SC.StageTargetPlatform.GetPlatformExecutableName("UE4Editor");
|
|
ExecutableNames.Add(CombinePaths(SC.RuntimeRootDir, "Engine/Binaries", SC.PlatformDir, ExeName + Ext));
|
|
}
|
|
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);
|
|
}
|
|
|
|
/// <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 inside of pak files
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public virtual bool DeployPakInternalLowerCaseFilenames()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/// <summary>
|
|
/// return true if we need to change the case of filenames outside of pak files
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public virtual bool DeployLowerCaseFilenames(bool bUFSFile)
|
|
{
|
|
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> GetDebugFileExtentions()
|
|
{
|
|
return new List<string>();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Remaps movie directory for platforms that need a remap
|
|
/// </summary>
|
|
public virtual bool StageMovies
|
|
{
|
|
get { return true; }
|
|
}
|
|
|
|
/// <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 true; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Remaps the given content directory to its final location
|
|
/// </summary>
|
|
public virtual string Remap(string 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()
|
|
{
|
|
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 List<string> GetFilesForCRCCheck()
|
|
{
|
|
string CmdLine = "UE4CommandLine.txt";
|
|
if (DeployLowerCaseFilenames(true))
|
|
{
|
|
CmdLine = CmdLine.ToLowerInvariant();
|
|
}
|
|
return new List<string>() { 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; }
|
|
}
|
|
|
|
#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;
|
|
}
|
|
|
|
public virtual bool ShouldUseManifestForUBTBuilds(string AddArgs)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/// <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";
|
|
}
|
|
|
|
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
|
|
}
|
|
}
|