2019-12-26 23:01:54 -05:00
// Copyright Epic Games, Inc. All Rights Reserved.
2014-03-14 14:13:41 -04:00
using System ;
using System.Collections.Generic ;
using System.Linq ;
using System.Text ;
using UnrealBuildTool ;
using System.IO ;
using System.Reflection ;
2017-08-31 12:08:38 -04:00
using Tools.DotNETCommon ;
2014-03-14 14:13:41 -04:00
namespace AutomationTool
{
[Help("targetplatform=PlatformName", "target platform for building, cooking and deployment (also -Platform)")]
[Help("servertargetplatform=PlatformName", "target platform for building, cooking and deployment of the dedicated server (also -ServerPlatform)")]
public class ProjectParams
{
/// <summary>
/// Gets a parameter from the command line if it hasn't been specified in the constructor.
/// If the command line is not available, default value will be used.
/// </summary>
/// <param name="Command">Command to parse the command line for. Can be null.</param>
/// <param name="SpecifiedValue">Value specified in the constructor (or not)</param>
/// <param name="Default">Default value.</param>
/// <param name="ParamNames">Command line parameter names to parse.</param>
/// <returns>Parameter value.</returns>
2016-12-13 11:58:16 -05:00
bool GetParamValueIfNotSpecified ( BuildCommand Command , bool? SpecifiedValue , bool Default , params string [ ] ParamNames )
2014-03-14 14:13:41 -04:00
{
if ( SpecifiedValue . HasValue )
{
return SpecifiedValue . Value ;
}
else if ( Command ! = null )
{
foreach ( var Param in ParamNames )
{
2015-08-18 15:17:14 -04:00
if ( Command . ParseParam ( Param ) )
{
return true ;
}
2014-03-14 14:13:41 -04:00
}
}
2015-08-18 15:17:14 -04:00
return Default ;
2014-03-14 14:13:41 -04:00
}
2018-08-14 18:32:34 -04:00
/// <summary>
/// Gets optional parameter from the command line if it hasn't been specified in the constructor.
/// If the command line is not available or the command has not been specified in the command line, default value will be used.
/// </summary>
/// <param name="Command">Command to parse the command line for. Can be null.</param>
/// <param name="SpecifiedValue">Value specified in the constructor (or not)</param>
/// <param name="Default">Default value.</param>
/// <param name="TrueParam">Name of a parameter that sets the value to 'true', for example: -clean</param>
/// <param name="FalseParam">Name of a parameter that sets the value to 'false', for example: -noclean</param>
/// <returns>Parameter value or default value if the paramater has not been specified</returns>
bool GetOptionalParamValueIfNotSpecified ( BuildCommand Command , bool? SpecifiedValue , bool Default , string TrueParam , string FalseParam )
{
return GetOptionalParamValueIfNotSpecified ( Command , SpecifiedValue , ( bool? ) Default , TrueParam , FalseParam ) . Value ;
}
2014-03-14 14:13:41 -04:00
/// <summary>
/// Gets optional parameter from the command line if it hasn't been specified in the constructor.
/// If the command line is not available or the command has not been specified in the command line, default value will be used.
/// </summary>
/// <param name="Command">Command to parse the command line for. Can be null.</param>
/// <param name="SpecifiedValue">Value specified in the constructor (or not)</param>
/// <param name="Default">Default value.</param>
/// <param name="TrueParam">Name of a parameter that sets the value to 'true', for example: -clean</param>
/// <param name="FalseParam">Name of a parameter that sets the value to 'false', for example: -noclean</param>
/// <returns>Parameter value or default value if the paramater has not been specified</returns>
2016-12-13 11:58:16 -05:00
bool? GetOptionalParamValueIfNotSpecified ( BuildCommand Command , bool? SpecifiedValue , bool? Default , string TrueParam , string FalseParam )
2014-03-14 14:13:41 -04:00
{
if ( SpecifiedValue . HasValue )
{
return SpecifiedValue . Value ;
}
else if ( Command ! = null )
{
bool? Value = null ;
if ( ! String . IsNullOrEmpty ( TrueParam ) & & Command . ParseParam ( TrueParam ) )
{
Value = true ;
}
else if ( ! String . IsNullOrEmpty ( FalseParam ) & & Command . ParseParam ( FalseParam ) )
{
Value = false ;
}
if ( Value . HasValue )
{
return Value ;
}
}
return Default ;
}
/// <summary>
/// Gets a parameter value from the command line if it hasn't been specified in the constructor.
/// If the command line is not available, default value will be used.
/// </summary>
/// <param name="Command">Command to parse the command line for. Can be null.</param>
/// <param name="SpecifiedValue">Value specified in the constructor (or not)</param>
/// <param name="ParamName">Command line parameter name to parse.</param>
/// <param name="Default">Default value</param>
2015-05-05 21:28:15 -04:00
/// <param name="bTrimQuotes">If set, the leading and trailing quotes will be removed, e.g. instead of "/home/User Name" it will return /home/User Name</param>
2014-03-14 14:13:41 -04:00
/// <returns>Parameter value.</returns>
2016-12-13 11:58:16 -05:00
string ParseParamValueIfNotSpecified ( BuildCommand Command , string SpecifiedValue , string ParamName , string Default = "" , bool bTrimQuotes = false )
2014-03-14 14:13:41 -04:00
{
2015-05-05 21:28:15 -04:00
string Result = Default ;
2014-03-14 14:13:41 -04:00
if ( SpecifiedValue ! = null )
{
2015-05-05 21:28:15 -04:00
Result = SpecifiedValue ;
2014-03-14 14:13:41 -04:00
}
else if ( Command ! = null )
{
2015-05-05 21:28:15 -04:00
Result = Command . ParseParamValue ( ParamName , Default ) ;
2014-03-14 14:13:41 -04:00
}
2015-05-05 21:28:15 -04:00
return bTrimQuotes ? Result . Trim ( new char [ ] { '\"' } ) : Result ;
2014-03-14 14:13:41 -04:00
}
/// <summary>
/// Sets up platforms
/// </summary>
2014-10-27 19:33:51 -04:00
/// <param name="DependentPlatformMap">Set with a mapping from source->destination if specified on command line</param>
2014-08-18 13:29:39 -04:00
/// <param name="Command">The command line to parse</param>
/// <param name="OverrideTargetPlatforms">If passed use this always</param>
2014-10-27 19:33:51 -04:00
/// <param name="DefaultTargetPlatforms">Use this if nothing is passed on command line</param>
2014-08-18 13:29:39 -04:00
/// <param name="AllowPlatformParams">Allow raw -platform options</param>
/// <param name="PlatformParamNames">Possible -parameters to check for</param>
2014-03-14 14:13:41 -04:00
/// <returns>List of platforms parsed from the command line</returns>
2016-12-13 11:58:16 -05:00
private List < TargetPlatformDescriptor > SetupTargetPlatforms ( ref Dictionary < TargetPlatformDescriptor , TargetPlatformDescriptor > DependentPlatformMap , BuildCommand Command , List < TargetPlatformDescriptor > OverrideTargetPlatforms , List < TargetPlatformDescriptor > DefaultTargetPlatforms , bool AllowPlatformParams , params string [ ] PlatformParamNames )
2014-03-14 14:13:41 -04:00
{
2016-07-19 19:13:01 -04:00
List < TargetPlatformDescriptor > TargetPlatforms = null ;
2014-03-14 14:13:41 -04:00
if ( CommandUtils . IsNullOrEmpty ( OverrideTargetPlatforms ) )
{
if ( Command ! = null )
{
// Parse the command line, we support the following params:
// -'PlatformParamNames[n]'=Platform_1+Platform_2+...+Platform_k
// or (if AllowPlatformParams is true)
// -Platform_1 -Platform_2 ... -Platform_k
string CmdLinePlatform = null ;
2019-06-10 11:58:40 -04:00
foreach ( string ParamName in PlatformParamNames )
2014-03-14 14:13:41 -04:00
{
2017-12-12 18:32:45 -05:00
string ParamValue = Command . ParseParamValue ( ParamName ) ;
if ( ! string . IsNullOrEmpty ( ParamValue ) )
2014-03-14 14:13:41 -04:00
{
2017-12-12 18:32:45 -05:00
if ( ! string . IsNullOrEmpty ( CmdLinePlatform ) )
{
CmdLinePlatform + = "+" ;
}
CmdLinePlatform + = ParamValue ;
2014-03-14 14:13:41 -04:00
}
}
2016-07-19 19:13:01 -04:00
List < string > CookFlavors = null ;
{
string CmdLineCookFlavor = Command . ParseParamValue ( "cookflavor" ) ;
if ( ! String . IsNullOrEmpty ( CmdLineCookFlavor ) )
{
2018-10-05 11:15:17 -04:00
CookFlavors = new List < string > ( CmdLineCookFlavor . Split ( new char [ ] { '+' } , StringSplitOptions . RemoveEmptyEntries ) ) ;
2016-07-19 19:13:01 -04:00
}
}
if ( ! String . IsNullOrEmpty ( CmdLinePlatform ) )
2014-03-14 14:13:41 -04:00
{
// Get all platforms from the param value: Platform_1+Platform_2+...+Platform_k
2016-07-19 19:13:01 -04:00
TargetPlatforms = new List < TargetPlatformDescriptor > ( ) ;
2019-06-10 11:58:40 -04:00
List < string > PlatformNames = ( new HashSet < string > ( CmdLinePlatform . Split ( new char [ ] { '+' } , StringSplitOptions . RemoveEmptyEntries ) ) ) . ToList ( ) ;
foreach ( string PlatformName in PlatformNames )
2014-03-14 14:13:41 -04:00
{
2014-10-27 19:33:51 -04:00
// Look for dependent platforms, Source_1.Dependent_1+Source_2.Dependent_2+Standalone_3
2019-06-10 11:58:40 -04:00
List < string > SubPlatformNames = new List < string > ( PlatformName . Split ( new char [ ] { '.' } , StringSplitOptions . RemoveEmptyEntries ) ) ;
2014-08-18 13:29:39 -04:00
2019-06-10 11:58:40 -04:00
foreach ( string SubPlatformName in SubPlatformNames )
2014-10-27 19:33:51 -04:00
{
2019-06-10 11:58:40 -04:00
// Require this to be a valid platform name
UnrealTargetPlatform NewPlatformType = UnrealTargetPlatform . Parse ( SubPlatformName ) ;
2016-07-19 19:13:01 -04:00
2019-06-10 11:58:40 -04:00
// generate all valid platform descriptions for this platform type + cook flavors
List < TargetPlatformDescriptor > PlatformDescriptors = Platform . GetValidTargetPlatforms ( NewPlatformType , CookFlavors ) ;
TargetPlatforms . AddRange ( PlatformDescriptors ) ;
if ( SubPlatformName ! = SubPlatformNames [ 0 ] )
{
// This is not supported with cook flavors
if ( ! CommandUtils . IsNullOrEmpty ( CookFlavors ) )
{
throw new AutomationException ( "Cook flavors are not supported for dependent platforms!" ) ;
}
// We're a dependent platform so add ourselves to the map, pointing to the first element in the list
UnrealTargetPlatform SubPlatformType ;
if ( UnrealTargetPlatform . TryParse ( SubPlatformNames [ 0 ] , out SubPlatformType ) )
{
DependentPlatformMap . Add ( new TargetPlatformDescriptor ( NewPlatformType ) , new TargetPlatformDescriptor ( SubPlatformType ) ) ;
2017-12-12 18:32:45 -05:00
}
}
2014-10-27 19:33:51 -04:00
}
2014-03-14 14:13:41 -04:00
}
}
else if ( AllowPlatformParams )
{
// Look up platform names in the command line: -Platform_1 -Platform_2 ... -Platform_k
2016-07-19 19:13:01 -04:00
TargetPlatforms = new List < TargetPlatformDescriptor > ( ) ;
2019-05-24 11:51:54 -04:00
foreach ( UnrealTargetPlatform PlatType in UnrealTargetPlatform . GetValidPlatforms ( ) )
2014-03-14 14:13:41 -04:00
{
2019-05-24 11:51:54 -04:00
if ( Command . ParseParam ( PlatType . ToString ( ) ) )
2014-03-14 14:13:41 -04:00
{
2019-05-24 11:51:54 -04:00
List < TargetPlatformDescriptor > PlatformDescriptors = Platform . GetValidTargetPlatforms ( PlatType , CookFlavors ) ;
TargetPlatforms . AddRange ( PlatformDescriptors ) ;
2014-03-14 14:13:41 -04:00
}
}
}
}
}
else
{
TargetPlatforms = OverrideTargetPlatforms ;
}
if ( CommandUtils . IsNullOrEmpty ( TargetPlatforms ) )
{
2014-07-17 04:43:21 -04:00
// Revert to single default platform - the current platform we're running
2014-03-14 14:13:41 -04:00
TargetPlatforms = DefaultTargetPlatforms ;
}
return TargetPlatforms ;
}
public ProjectParams ( ProjectParams InParams )
{
//
//// Use this.Name with properties and fields!
//
this . RawProjectPath = InParams . RawProjectPath ;
this . MapsToCook = InParams . MapsToCook ;
2017-01-27 23:32:44 -05:00
this . MapIniSectionsToCook = InParams . MapIniSectionsToCook ;
2014-03-14 14:13:41 -04:00
this . DirectoriesToCook = InParams . DirectoriesToCook ;
2020-09-24 00:43:27 -04:00
this . DDCGraph = InParams . DDCGraph ;
2014-10-27 19:33:51 -04:00
this . InternationalizationPreset = InParams . InternationalizationPreset ;
this . CulturesToCook = InParams . CulturesToCook ;
2014-12-15 11:35:52 -05:00
this . BasedOnReleaseVersion = InParams . BasedOnReleaseVersion ;
this . CreateReleaseVersion = InParams . CreateReleaseVersion ;
2015-03-30 11:56:48 -04:00
this . GeneratePatch = InParams . GeneratePatch ;
2017-06-21 17:09:40 -04:00
this . AddPatchLevel = InParams . AddPatchLevel ;
this . StageBaseReleasePaks = InParams . StageBaseReleasePaks ;
2017-07-21 12:42:36 -04:00
this . DLCFile = InParams . DLCFile ;
2017-08-03 14:06:31 -04:00
this . GenerateRemaster = InParams . GenerateRemaster ;
2017-12-05 21:57:41 -05:00
this . DiscVersion = InParams . DiscVersion ;
2015-04-20 11:15:20 -04:00
this . DLCIncludeEngineContent = InParams . DLCIncludeEngineContent ;
2017-11-09 18:22:55 -05:00
this . DLCActLikePatch = InParams . DLCActLikePatch ;
this . DLCPakPluginFile = InParams . DLCPakPluginFile ;
2015-08-11 17:11:41 -04:00
this . DiffCookedContentPath = InParams . DiffCookedContentPath ;
2014-12-15 11:35:52 -05:00
this . AdditionalCookerOptions = InParams . AdditionalCookerOptions ;
2014-03-14 14:13:41 -04:00
this . ClientCookedTargets = InParams . ClientCookedTargets ;
this . ServerCookedTargets = InParams . ServerCookedTargets ;
this . EditorTargets = InParams . EditorTargets ;
this . ProgramTargets = InParams . ProgramTargets ;
2019-09-13 13:29:44 -04:00
this . TargetNames = new List < string > ( InParams . TargetNames ) ;
2014-03-14 14:13:41 -04:00
this . ClientTargetPlatforms = InParams . ClientTargetPlatforms ;
2014-10-27 19:33:51 -04:00
this . ClientDependentPlatformMap = InParams . ClientDependentPlatformMap ;
2014-03-14 14:13:41 -04:00
this . ServerTargetPlatforms = InParams . ServerTargetPlatforms ;
2014-10-27 19:33:51 -04:00
this . ServerDependentPlatformMap = InParams . ServerDependentPlatformMap ;
2014-03-14 14:13:41 -04:00
this . Build = InParams . Build ;
2017-05-16 13:13:20 -04:00
this . SkipBuildClient = InParams . SkipBuildClient ;
this . SkipBuildEditor = InParams . SkipBuildEditor ;
2014-03-14 14:13:41 -04:00
this . Run = InParams . Run ;
this . Cook = InParams . Cook ;
this . IterativeCooking = InParams . IterativeCooking ;
2016-11-21 20:27:58 -05:00
this . IterateSharedCookedBuild = InParams . IterateSharedCookedBuild ;
2017-05-16 13:13:20 -04:00
this . IterateSharedBuildUsePrecompiledExe = InParams . IterateSharedBuildUsePrecompiledExe ;
2017-11-09 18:22:55 -05:00
this . CookAll = InParams . CookAll ;
2016-09-09 20:13:41 -04:00
this . CookPartialGC = InParams . CookPartialGC ;
2016-11-21 20:27:58 -05:00
this . CookInEditor = InParams . CookInEditor ;
2017-04-10 11:00:33 -04:00
this . CookOutputDir = InParams . CookOutputDir ;
2016-11-21 20:27:58 -05:00
this . CookMapsOnly = InParams . CookMapsOnly ;
2014-03-14 14:13:41 -04:00
this . SkipCook = InParams . SkipCook ;
this . SkipCookOnTheFly = InParams . SkipCookOnTheFly ;
2014-10-27 19:33:51 -04:00
this . Prebuilt = InParams . Prebuilt ;
this . RunTimeoutSeconds = InParams . RunTimeoutSeconds ;
2014-03-14 14:13:41 -04:00
this . Clean = InParams . Clean ;
this . Pak = InParams . Pak ;
2020-02-27 20:59:51 -05:00
this . IgnorePaksFromDifferentCookSource = InParams . IgnorePaksFromDifferentCookSource ;
2019-11-25 12:03:09 -05:00
this . IoStore = InParams . IoStore ;
2014-03-14 14:13:41 -04:00
this . SignPak = InParams . SignPak ;
this . SignedPak = InParams . SignedPak ;
2019-02-12 10:27:29 -05:00
this . PakAlignForMemoryMapping = InParams . PakAlignForMemoryMapping ;
2014-03-14 14:13:41 -04:00
this . SkipPak = InParams . SkipPak ;
2018-02-22 11:25:06 -05:00
this . PrePak = InParams . PrePak ;
this . NoXGE = InParams . NoXGE ;
2014-03-14 14:13:41 -04:00
this . CookOnTheFly = InParams . CookOnTheFly ;
2015-01-15 16:07:06 -05:00
this . CookOnTheFlyStreaming = InParams . CookOnTheFlyStreaming ;
2015-02-04 16:18:11 -05:00
this . UnversionedCookedContent = InParams . UnversionedCookedContent ;
2016-11-22 18:45:44 -05:00
this . SkipCookingEditorContent = InParams . SkipCookingEditorContent ;
2015-07-06 10:03:34 -04:00
this . NumCookersToSpawn = InParams . NumCookersToSpawn ;
2014-03-14 14:13:41 -04:00
this . FileServer = InParams . FileServer ;
this . DedicatedServer = InParams . DedicatedServer ;
this . Client = InParams . Client ;
this . NoClient = InParams . NoClient ;
this . LogWindow = InParams . LogWindow ;
this . Stage = InParams . Stage ;
this . SkipStage = InParams . SkipStage ;
2014-10-27 19:33:51 -04:00
this . StageDirectoryParam = InParams . StageDirectoryParam ;
2014-03-14 14:13:41 -04:00
this . Manifests = InParams . Manifests ;
2014-10-27 19:33:51 -04:00
this . CreateChunkInstall = InParams . CreateChunkInstall ;
2014-03-14 14:13:41 -04:00
this . UE4Exe = InParams . UE4Exe ;
this . NoDebugInfo = InParams . NoDebugInfo ;
2018-02-22 11:25:06 -05:00
this . SeparateDebugInfo = InParams . SeparateDebugInfo ;
2017-05-03 14:18:32 -04:00
this . MapFile = InParams . MapFile ;
2014-03-14 14:13:41 -04:00
this . NoCleanStage = InParams . NoCleanStage ;
this . MapToRun = InParams . MapToRun ;
2014-04-23 16:44:23 -04:00
this . AdditionalServerMapParams = InParams . AdditionalServerMapParams ;
2014-03-14 14:13:41 -04:00
this . Foreign = InParams . Foreign ;
this . ForeignCode = InParams . ForeignCode ;
this . StageCommandline = InParams . StageCommandline ;
2014-10-27 19:33:51 -04:00
this . BundleName = InParams . BundleName ;
2014-03-14 14:13:41 -04:00
this . RunCommandline = InParams . RunCommandline ;
2016-09-01 21:20:38 -04:00
this . ServerCommandline = InParams . ServerCommandline ;
2017-05-09 17:15:32 -04:00
this . ClientCommandline = InParams . ClientCommandline ;
2016-09-01 21:20:38 -04:00
this . Package = InParams . Package ;
2020-04-10 11:30:32 -04:00
this . SkipPackage = InParams . SkipPackage ;
2018-02-22 11:25:06 -05:00
this . ForcePackageData = InParams . ForcePackageData ;
2014-03-14 14:13:41 -04:00
this . Deploy = InParams . Deploy ;
2016-11-20 21:35:35 -05:00
this . DeployFolder = InParams . DeployFolder ;
2018-04-03 15:23:51 -04:00
this . GetFile = InParams . GetFile ;
2014-12-11 16:20:07 -05:00
this . IterativeDeploy = InParams . IterativeDeploy ;
2015-06-09 10:11:45 -04:00
this . IgnoreCookErrors = InParams . IgnoreCookErrors ;
this . FastCook = InParams . FastCook ;
2016-07-19 19:13:01 -04:00
this . Devices = InParams . Devices ;
this . DeviceNames = InParams . DeviceNames ;
2014-03-14 14:13:41 -04:00
this . ServerDevice = InParams . ServerDevice ;
2014-10-27 19:33:51 -04:00
this . NullRHI = InParams . NullRHI ;
this . FakeClient = InParams . FakeClient ;
this . EditorTest = InParams . EditorTest ;
this . RunAutomationTests = InParams . RunAutomationTests ;
this . RunAutomationTest = InParams . RunAutomationTest ;
this . CrashIndex = InParams . CrashIndex ;
this . Port = InParams . Port ;
2014-03-14 14:13:41 -04:00
this . SkipServer = InParams . SkipServer ;
this . Unattended = InParams . Unattended ;
2014-10-27 19:33:51 -04:00
this . ServerDeviceAddress = InParams . ServerDeviceAddress ;
this . DeviceUsername = InParams . DeviceUsername ;
this . DevicePassword = InParams . DevicePassword ;
this . CrashReporter = InParams . CrashReporter ;
2014-03-14 14:13:41 -04:00
this . ClientConfigsToBuild = InParams . ClientConfigsToBuild ;
this . ServerConfigsToBuild = InParams . ServerConfigsToBuild ;
this . NumClients = InParams . NumClients ;
2014-10-27 19:33:51 -04:00
this . Compressed = InParams . Compressed ;
2018-05-23 21:04:31 -04:00
this . AdditionalPakOptions = InParams . AdditionalPakOptions ;
2020-09-01 14:07:48 -04:00
this . AdditionalIoStoreOptions = InParams . AdditionalIoStoreOptions ;
2014-03-14 14:13:41 -04:00
this . Archive = InParams . Archive ;
this . ArchiveDirectoryParam = InParams . ArchiveDirectoryParam ;
2014-10-24 11:50:48 -04:00
this . ArchiveMetaData = InParams . ArchiveMetaData ;
2015-07-29 17:47:13 -04:00
this . CreateAppBundle = InParams . CreateAppBundle ;
2014-03-14 14:13:41 -04:00
this . Distribution = InParams . Distribution ;
2014-09-23 13:55:06 -04:00
this . Prereqs = InParams . Prereqs ;
2016-07-12 15:06:08 -04:00
this . AppLocalDirectory = InParams . AppLocalDirectory ;
2014-10-15 10:07:06 -04:00
this . NoBootstrapExe = InParams . NoBootstrapExe ;
2014-10-27 19:33:51 -04:00
this . Prebuilt = InParams . Prebuilt ;
this . RunTimeoutSeconds = InParams . RunTimeoutSeconds ;
2015-04-09 10:13:10 -04:00
this . bIsCodeBasedProject = InParams . bIsCodeBasedProject ;
2015-07-10 14:06:52 -04:00
this . bCodeSign = InParams . bCodeSign ;
2015-12-08 09:25:02 -05:00
this . TitleID = InParams . TitleID ;
2016-03-14 21:21:09 -04:00
this . bTreatNonShippingBinariesAsDebugFiles = InParams . bTreatNonShippingBinariesAsDebugFiles ;
2018-02-22 11:25:06 -05:00
this . bUseExtraFlavor = InParams . bUseExtraFlavor ;
2015-12-08 09:25:02 -05:00
this . RunAssetNativization = InParams . RunAssetNativization ;
2018-11-14 19:05:13 -05:00
this . AdditionalPackageOptions = InParams . AdditionalPackageOptions ;
2014-03-14 14:13:41 -04:00
}
/// <summary>
/// Constructor. Be sure to use this.ParamName to set the actual property name as parameter names and property names
/// overlap here.
2016-01-08 19:10:43 -05:00
/// If a parameter value is not set, it will be parsed from the command line; if the command is null, the default value will be used.
2014-03-14 14:13:41 -04:00
/// </summary>
public ProjectParams (
2015-09-26 14:41:15 -04:00
FileReference RawProjectPath ,
2014-03-14 14:13:41 -04:00
2016-12-13 11:58:16 -05:00
BuildCommand Command = null ,
2014-03-14 14:13:41 -04:00
string Device = null ,
2014-04-23 16:44:23 -04:00
string MapToRun = null ,
string AdditionalServerMapParams = null ,
2014-07-07 17:14:45 -04:00
ParamList < string > Port = null ,
2014-03-14 14:13:41 -04:00
string RunCommandline = null ,
string StageCommandline = null ,
2014-10-27 19:33:51 -04:00
string BundleName = null ,
string StageDirectoryParam = null ,
2014-03-14 14:13:41 -04:00
string UE4Exe = null ,
string SignPak = null ,
List < UnrealTargetConfiguration > ClientConfigsToBuild = null ,
List < UnrealTargetConfiguration > ServerConfigsToBuild = null ,
ParamList < string > MapsToCook = null ,
2017-01-27 23:32:44 -05:00
ParamList < string > MapIniSectionsToCook = null ,
2014-03-14 14:13:41 -04:00
ParamList < string > DirectoriesToCook = null ,
2020-09-24 00:43:27 -04:00
string DDCGraph = null ,
2014-10-27 19:33:51 -04:00
string InternationalizationPreset = null ,
ParamList < string > CulturesToCook = null ,
2014-03-14 14:13:41 -04:00
ParamList < string > ClientCookedTargets = null ,
ParamList < string > EditorTargets = null ,
ParamList < string > ServerCookedTargets = null ,
2016-07-19 19:13:01 -04:00
List < TargetPlatformDescriptor > ClientTargetPlatforms = null ,
Dictionary < TargetPlatformDescriptor , TargetPlatformDescriptor > ClientDependentPlatformMap = null ,
List < TargetPlatformDescriptor > ServerTargetPlatforms = null ,
Dictionary < TargetPlatformDescriptor , TargetPlatformDescriptor > ServerDependentPlatformMap = null ,
2014-03-14 14:13:41 -04:00
bool? Build = null ,
2017-05-16 13:13:20 -04:00
bool? SkipBuildClient = null ,
bool? SkipBuildEditor = null ,
2014-03-14 14:13:41 -04:00
bool? Cook = null ,
bool? Run = null ,
bool? SkipServer = null ,
bool? Clean = null ,
2014-10-27 19:33:51 -04:00
bool? Compressed = null ,
2018-05-23 21:04:31 -04:00
string AdditionalPakOptions = null ,
2020-09-01 14:07:48 -04:00
string AdditionalIoStoreOptions = null ,
2014-10-27 19:33:51 -04:00
bool? IterativeCooking = null ,
2018-05-23 21:04:31 -04:00
string IterateSharedCookedBuild = null ,
2017-05-16 13:13:20 -04:00
bool? IterateSharedBuildUsePrecompiledExe = null ,
2016-11-21 20:27:58 -05:00
bool? CookAll = null ,
2016-09-09 20:13:41 -04:00
bool? CookPartialGC = null ,
2016-11-21 20:27:58 -05:00
bool? CookInEditor = null ,
2017-04-10 11:00:33 -04:00
string CookOutputDir = null ,
2016-11-21 20:27:58 -05:00
bool? CookMapsOnly = null ,
2015-01-15 16:07:06 -05:00
bool? CookOnTheFly = null ,
bool? CookOnTheFlyStreaming = null ,
2015-02-04 16:18:11 -05:00
bool? UnversionedCookedContent = null ,
2016-07-22 11:36:47 -04:00
bool? EncryptIniFiles = null ,
2017-04-10 11:00:33 -04:00
bool? EncryptPakIndex = null ,
2017-11-09 18:22:55 -05:00
bool? EncryptEverything = null ,
2016-11-22 18:45:44 -05:00
bool? SkipCookingEditorContent = null ,
2015-07-06 10:03:34 -04:00
int? NumCookersToSpawn = null ,
2014-12-15 11:35:52 -05:00
string AdditionalCookerOptions = null ,
string BasedOnReleaseVersion = null ,
string CreateReleaseVersion = null ,
2015-10-06 15:59:09 -04:00
string CreateReleaseVersionBasePath = null ,
string BasedOnReleaseVersionBasePath = null ,
2015-03-30 11:56:48 -04:00
bool? GeneratePatch = null ,
2017-06-21 17:09:40 -04:00
bool? AddPatchLevel = null ,
bool? StageBaseReleasePaks = null ,
2017-08-03 14:06:31 -04:00
bool? GenerateRemaster = null ,
2017-12-05 21:57:41 -05:00
string DiscVersion = null ,
2017-11-09 18:22:55 -05:00
string DLCName = null ,
2015-08-11 17:11:41 -04:00
string DiffCookedContentPath = null ,
2015-04-20 11:15:20 -04:00
bool? DLCIncludeEngineContent = null ,
2017-11-09 18:22:55 -05:00
bool? DLCPakPluginFile = null ,
bool? DLCActLikePatch = null ,
2014-03-14 14:13:41 -04:00
bool? CrashReporter = null ,
bool? DedicatedServer = null ,
bool? Client = null ,
bool? Deploy = null ,
2016-11-20 21:35:35 -05:00
string DeployFolder = null ,
2018-04-03 15:23:51 -04:00
string GetFile = null ,
2014-03-14 14:13:41 -04:00
bool? FileServer = null ,
bool? Foreign = null ,
bool? ForeignCode = null ,
bool? LogWindow = null ,
bool? NoCleanStage = null ,
bool? NoClient = null ,
bool? NoDebugInfo = null ,
2018-02-22 11:25:06 -05:00
bool? SeparateDebugInfo = null ,
2017-05-03 14:18:32 -04:00
bool? MapFile = null ,
2014-03-14 14:13:41 -04:00
bool? NoXGE = null ,
2020-04-10 11:30:32 -04:00
bool? SkipPackage = null ,
2014-03-14 14:13:41 -04:00
bool? Package = null ,
bool? Pak = null ,
2020-02-27 20:59:51 -05:00
bool? IgnorePaksFromDifferentCookSource = null ,
2019-11-25 12:03:09 -05:00
bool? IoStore = null ,
2020-02-06 13:13:41 -05:00
bool? SkipIoStore = null ,
2014-09-23 13:55:06 -04:00
bool? Prereqs = null ,
2016-07-12 15:06:08 -04:00
string AppLocalDirectory = null ,
2014-10-15 10:07:06 -04:00
bool? NoBootstrapExe = null ,
2014-10-27 19:33:51 -04:00
bool? SignedPak = null ,
2019-02-12 10:27:29 -05:00
bool? PakAlignForMemoryMapping = null ,
bool? NullRHI = null ,
2014-10-27 19:33:51 -04:00
bool? FakeClient = null ,
bool? EditorTest = null ,
bool? RunAutomationTests = null ,
string RunAutomationTest = null ,
int? CrashIndex = null ,
2014-03-14 14:13:41 -04:00
bool? SkipCook = null ,
bool? SkipCookOnTheFly = null ,
bool? SkipPak = null ,
2018-02-22 11:25:06 -05:00
bool? PrePak = null ,
bool? SkipStage = null ,
2014-03-14 14:13:41 -04:00
bool? Stage = null ,
bool? Manifests = null ,
2014-10-27 19:33:51 -04:00
bool? CreateChunkInstall = null ,
2014-03-14 14:13:41 -04:00
bool? Unattended = null ,
int? NumClients = null ,
bool? Archive = null ,
string ArchiveDirectoryParam = null ,
2014-10-24 11:50:48 -04:00
bool? ArchiveMetaData = null ,
2015-07-29 17:47:13 -04:00
bool? CreateAppBundle = null ,
2018-08-20 13:55:11 -04:00
string SpecifiedClientTarget = null ,
string SpecifiedServerTarget = null ,
2014-03-14 14:13:41 -04:00
ParamList < string > ProgramTargets = null ,
2014-05-13 11:40:41 -04:00
bool? Distribution = null ,
2014-10-27 19:33:51 -04:00
bool? Prebuilt = null ,
2014-12-06 10:29:12 -05:00
int? RunTimeoutSeconds = null ,
2015-05-13 12:27:09 -04:00
string SpecifiedArchitecture = null ,
2018-02-22 11:25:06 -05:00
string UbtArgs = null ,
2018-11-14 19:05:13 -05:00
string AdditionalPackageOptions = null ,
bool? IterativeDeploy = null ,
2015-06-09 10:11:45 -04:00
bool? FastCook = null ,
2015-07-10 14:06:52 -04:00
bool? IgnoreCookErrors = null ,
2015-11-25 18:47:20 -05:00
bool? RunAssetNativization = null ,
2015-08-21 17:27:15 -04:00
bool? CodeSign = null ,
2016-03-14 21:21:09 -04:00
bool? TreatNonShippingBinariesAsDebugFiles = null ,
2018-02-22 11:25:06 -05:00
bool? UseExtraFlavor = null ,
2015-09-29 10:04:26 -04:00
string Provision = null ,
2015-10-02 14:24:38 -04:00
string Certificate = null ,
2017-04-11 10:32:07 -04:00
string Team = null ,
bool AutomaticSigning = false ,
2015-12-08 09:25:02 -05:00
ParamList < string > InMapsToRebuildLightMaps = null ,
2018-02-22 11:25:06 -05:00
ParamList < string > InMapsToRebuildHLOD = null ,
ParamList < string > TitleID = null
2014-03-14 14:13:41 -04:00
)
{
//
//// Use this.Name with properties and fields!
//
this . RawProjectPath = RawProjectPath ;
if ( DirectoriesToCook ! = null )
{
this . DirectoriesToCook = DirectoriesToCook ;
}
2020-09-24 00:43:27 -04:00
this . DDCGraph = ParseParamValueIfNotSpecified ( Command , DDCGraph , "ddc" ) ;
2014-10-27 19:33:51 -04:00
this . InternationalizationPreset = ParseParamValueIfNotSpecified ( Command , InternationalizationPreset , "i18npreset" ) ;
2016-01-08 19:10:43 -05:00
// If not specified in parameters, check commandline.
if ( CulturesToCook = = null )
{
if ( Command ! = null )
{
var CookCulturesString = Command . ParseParamValue ( "CookCultures" ) ;
if ( CookCulturesString ! = null )
{
2018-10-05 11:15:17 -04:00
this . CulturesToCook = new ParamList < string > ( CookCulturesString . Split ( new char [ ] { ',' } , StringSplitOptions . RemoveEmptyEntries ) ) ;
2016-01-08 19:10:43 -05:00
}
}
}
else
{
2014-10-27 19:33:51 -04:00
this . CulturesToCook = CulturesToCook ;
2016-01-08 19:10:43 -05:00
}
2014-03-14 14:13:41 -04:00
if ( ClientCookedTargets ! = null )
{
this . ClientCookedTargets = ClientCookedTargets ;
}
if ( ServerCookedTargets ! = null )
{
this . ServerCookedTargets = ServerCookedTargets ;
}
if ( EditorTargets ! = null )
{
this . EditorTargets = EditorTargets ;
}
if ( ProgramTargets ! = null )
{
this . ProgramTargets = ProgramTargets ;
}
2014-08-18 13:29:39 -04:00
// Parse command line params for client platforms "-TargetPlatform=Win64+Mac", "-Platform=Win64+Mac" and also "-Win64", "-Mac" etc.
2014-10-27 19:33:51 -04:00
if ( ClientDependentPlatformMap ! = null )
{
this . ClientDependentPlatformMap = ClientDependentPlatformMap ;
}
2015-01-07 10:19:26 -05:00
2016-07-19 19:13:01 -04:00
List < TargetPlatformDescriptor > DefaultTargetPlatforms = new ParamList < TargetPlatformDescriptor > ( new TargetPlatformDescriptor ( HostPlatform . Current . HostEditorPlatform ) ) ;
this . ClientTargetPlatforms = SetupTargetPlatforms ( ref this . ClientDependentPlatformMap , Command , ClientTargetPlatforms , DefaultTargetPlatforms , true , "TargetPlatform" , "Platform" ) ;
2014-03-14 14:13:41 -04:00
2014-10-27 19:33:51 -04:00
// Parse command line params for server platforms "-ServerTargetPlatform=Win64+Mac", "-ServerPlatform=Win64+Mac". "-Win64" etc is not allowed here
if ( ServerDependentPlatformMap ! = null )
{
this . ServerDependentPlatformMap = ServerDependentPlatformMap ;
}
this . ServerTargetPlatforms = SetupTargetPlatforms ( ref this . ServerDependentPlatformMap , Command , ServerTargetPlatforms , this . ClientTargetPlatforms , false , "ServerTargetPlatform" , "ServerPlatform" ) ;
2014-03-14 14:13:41 -04:00
this . Build = GetParamValueIfNotSpecified ( Command , Build , this . Build , "build" ) ;
2018-09-25 10:11:35 -04:00
bool bSkipBuild = GetParamValueIfNotSpecified ( Command , null , false , "skipbuild" ) ;
if ( bSkipBuild )
{
this . Build = false ;
}
2018-08-14 18:32:34 -04:00
this . SkipBuildClient = GetParamValueIfNotSpecified ( Command , SkipBuildClient , this . SkipBuildClient , "skipbuildclient" ) ;
2017-05-16 13:13:20 -04:00
this . SkipBuildEditor = GetParamValueIfNotSpecified ( Command , SkipBuildEditor , this . SkipBuildEditor , "skipbuildeditor" ) ;
2014-03-14 14:13:41 -04:00
this . Run = GetParamValueIfNotSpecified ( Command , Run , this . Run , "run" ) ;
this . Cook = GetParamValueIfNotSpecified ( Command , Cook , this . Cook , "cook" ) ;
2015-09-09 09:35:59 -04:00
this . CreateReleaseVersionBasePath = ParseParamValueIfNotSpecified ( Command , CreateReleaseVersionBasePath , "createreleaseversionroot" , String . Empty ) ;
this . BasedOnReleaseVersionBasePath = ParseParamValueIfNotSpecified ( Command , BasedOnReleaseVersionBasePath , "basedonreleaseversionroot" , String . Empty ) ;
2014-12-15 11:35:52 -05:00
this . CreateReleaseVersion = ParseParamValueIfNotSpecified ( Command , CreateReleaseVersion , "createreleaseversion" , String . Empty ) ;
this . BasedOnReleaseVersion = ParseParamValueIfNotSpecified ( Command , BasedOnReleaseVersion , "basedonreleaseversion" , String . Empty ) ;
2015-03-30 11:56:48 -04:00
this . GeneratePatch = GetParamValueIfNotSpecified ( Command , GeneratePatch , this . GeneratePatch , "GeneratePatch" ) ;
2017-06-21 17:09:40 -04:00
this . AddPatchLevel = GetParamValueIfNotSpecified ( Command , AddPatchLevel , this . AddPatchLevel , "AddPatchLevel" ) ;
this . StageBaseReleasePaks = GetParamValueIfNotSpecified ( Command , StageBaseReleasePaks , this . StageBaseReleasePaks , "StageBaseReleasePaks" ) ;
2017-08-03 14:06:31 -04:00
this . GenerateRemaster = GetParamValueIfNotSpecified ( Command , GenerateRemaster , this . GenerateRemaster , "GenerateRemaster" ) ;
2017-12-05 21:57:41 -05:00
this . DiscVersion = ParseParamValueIfNotSpecified ( Command , DiscVersion , "DiscVersion" , String . Empty ) ;
this . AdditionalCookerOptions = ParseParamValueIfNotSpecified ( Command , AdditionalCookerOptions , "AdditionalCookerOptions" , String . Empty ) ;
2017-07-21 12:42:36 -04:00
DLCName = ParseParamValueIfNotSpecified ( Command , DLCName , "DLCName" , String . Empty ) ;
if ( ! String . IsNullOrEmpty ( DLCName ) )
{
2019-11-08 11:23:41 -05:00
List < PluginInfo > CandidatePlugins = Plugins . ReadAvailablePlugins ( CommandUtils . EngineDirectory , DirectoryReference . FromFile ( RawProjectPath ) , null ) ;
2017-07-21 12:42:36 -04:00
PluginInfo DLCPlugin = CandidatePlugins . FirstOrDefault ( x = > String . Equals ( x . Name , DLCName , StringComparison . InvariantCultureIgnoreCase ) ) ;
if ( DLCPlugin = = null )
{
2018-03-24 09:22:20 -04:00
DLCFile = FileReference . Combine ( RawProjectPath . Directory , "Plugins" , DLCName , DLCName + ".uplugin" ) ;
}
else
{
DLCFile = DLCPlugin . File ;
2017-07-21 12:42:36 -04:00
}
}
//this.DLCName =
2015-08-11 17:11:41 -04:00
this . DiffCookedContentPath = ParseParamValueIfNotSpecified ( Command , DiffCookedContentPath , "DiffCookedContentPath" , String . Empty ) ;
2015-04-20 11:15:20 -04:00
this . DLCIncludeEngineContent = GetParamValueIfNotSpecified ( Command , DLCIncludeEngineContent , this . DLCIncludeEngineContent , "DLCIncludeEngineContent" ) ;
2017-11-09 18:22:55 -05:00
this . DLCPakPluginFile = GetParamValueIfNotSpecified ( Command , DLCPakPluginFile , this . DLCPakPluginFile , "DLCPakPluginFile" ) ;
this . DLCActLikePatch = GetParamValueIfNotSpecified ( Command , DLCActLikePatch , this . DLCActLikePatch , "DLCActLikePatch" ) ;
2014-03-14 14:13:41 -04:00
this . SkipCook = GetParamValueIfNotSpecified ( Command , SkipCook , this . SkipCook , "skipcook" ) ;
if ( this . SkipCook )
{
this . Cook = true ;
}
this . Clean = GetOptionalParamValueIfNotSpecified ( Command , Clean , this . Clean , "clean" , null ) ;
this . SignPak = ParseParamValueIfNotSpecified ( Command , SignPak , "signpak" , String . Empty ) ;
this . SignedPak = ! String . IsNullOrEmpty ( this . SignPak ) | | GetParamValueIfNotSpecified ( Command , SignedPak , this . SignedPak , "signedpak" ) ;
2016-03-24 13:53:55 -04:00
if ( string . IsNullOrEmpty ( this . SignPak ) )
{
2020-04-11 08:47:06 -04:00
this . SignPak = Path . Combine ( RawProjectPath . Directory . FullName , @"Restricted\NoRedist\Build\Keys.txt" ) ;
2016-03-24 13:53:55 -04:00
if ( ! File . Exists ( this . SignPak ) )
{
this . SignPak = null ;
}
}
2019-02-12 10:27:29 -05:00
this . PakAlignForMemoryMapping = GetParamValueIfNotSpecified ( Command , PakAlignForMemoryMapping , this . PakAlignForMemoryMapping , "PakAlignForMemoryMapping" ) ;
2016-05-16 16:20:52 -04:00
this . Pak = GetParamValueIfNotSpecified ( Command , Pak , this . Pak , "pak" ) ;
2020-02-27 20:59:51 -05:00
this . IgnorePaksFromDifferentCookSource = GetParamValueIfNotSpecified ( Command , IgnorePaksFromDifferentCookSource , this . IgnorePaksFromDifferentCookSource , "IgnorePaksFromDifferentCookSource" ) ;
2019-11-25 12:03:09 -05:00
this . IoStore = GetParamValueIfNotSpecified ( Command , IoStore , this . IoStore , "iostore" ) ;
2020-09-01 14:07:48 -04:00
this . SkipIoStore = GetParamValueIfNotSpecified ( Command , SkipIoStore , this . SkipIoStore , "skipiostore" ) ;
2014-03-14 14:13:41 -04:00
this . SkipPak = GetParamValueIfNotSpecified ( Command , SkipPak , this . SkipPak , "skippak" ) ;
if ( this . SkipPak )
{
this . Pak = true ;
}
2018-02-22 11:25:06 -05:00
this . PrePak = GetParamValueIfNotSpecified ( Command , PrePak , this . PrePak , "prepak" ) ;
if ( this . PrePak )
{
this . Pak = true ;
this . SkipCook = true ;
}
this . NoXGE = GetParamValueIfNotSpecified ( Command , NoXGE , this . NoXGE , "noxge" ) ;
2014-03-14 14:13:41 -04:00
this . CookOnTheFly = GetParamValueIfNotSpecified ( Command , CookOnTheFly , this . CookOnTheFly , "cookonthefly" ) ;
2015-01-15 16:07:06 -05:00
if ( this . CookOnTheFly & & this . SkipCook )
{
this . Cook = false ;
}
this . CookOnTheFlyStreaming = GetParamValueIfNotSpecified ( Command , CookOnTheFlyStreaming , this . CookOnTheFlyStreaming , "cookontheflystreaming" ) ;
2018-08-14 18:32:34 -04:00
this . UnversionedCookedContent = GetOptionalParamValueIfNotSpecified ( Command , UnversionedCookedContent , this . UnversionedCookedContent , "UnversionedCookedContent" , "VersionCookedContent" ) ;
2016-07-22 11:36:47 -04:00
this . SkipCookingEditorContent = GetParamValueIfNotSpecified ( Command , SkipCookingEditorContent , this . SkipCookingEditorContent , "SkipCookingEditorContent" ) ;
2015-07-06 10:03:34 -04:00
if ( NumCookersToSpawn . HasValue )
{
this . NumCookersToSpawn = NumCookersToSpawn . Value ;
}
else if ( Command ! = null )
{
this . NumCookersToSpawn = Command . ParseParamInt ( "NumCookersToSpawn" ) ;
}
2014-10-27 19:33:51 -04:00
this . Compressed = GetParamValueIfNotSpecified ( Command , Compressed , this . Compressed , "compressed" ) ;
2018-05-23 21:04:31 -04:00
this . AdditionalPakOptions = ParseParamValueIfNotSpecified ( Command , AdditionalPakOptions , "AdditionalPakOptions" ) ;
2020-09-01 14:07:48 -04:00
this . AdditionalIoStoreOptions = ParseParamValueIfNotSpecified ( Command , AdditionalIoStoreOptions , "AdditionalIoStoreOptions" ) ;
2016-11-21 20:27:58 -05:00
this . IterativeCooking = GetParamValueIfNotSpecified ( Command , IterativeCooking , this . IterativeCooking , new string [ ] { "iterativecooking" , "iterate" } ) ;
2018-05-23 21:04:31 -04:00
this . IterateSharedCookedBuild = GetParamValueIfNotSpecified ( Command , false , false , "iteratesharedcookedbuild" ) ? "usesyncedbuild" : null ;
this . IterateSharedCookedBuild = ParseParamValueIfNotSpecified ( Command , IterateSharedCookedBuild , "IterateSharedCookedBuild" , String . Empty ) ;
2017-05-16 13:13:20 -04:00
this . IterateSharedBuildUsePrecompiledExe = GetParamValueIfNotSpecified ( Command , IterateSharedBuildUsePrecompiledExe , this . IterateSharedBuildUsePrecompiledExe , new string [ ] { "IterateSharedBuildUsePrecompiledExe" } ) ;
2017-11-09 18:22:55 -05:00
2014-03-14 14:13:41 -04:00
this . SkipCookOnTheFly = GetParamValueIfNotSpecified ( Command , SkipCookOnTheFly , this . SkipCookOnTheFly , "skipcookonthefly" ) ;
2016-09-09 20:13:41 -04:00
this . CookAll = GetParamValueIfNotSpecified ( Command , CookAll , this . CookAll , "CookAll" ) ;
this . CookPartialGC = GetParamValueIfNotSpecified ( Command , CookPartialGC , this . CookPartialGC , "CookPartialGC" ) ;
2016-11-21 20:27:58 -05:00
this . CookInEditor = GetParamValueIfNotSpecified ( Command , CookInEditor , this . CookInEditor , "CookInEditor" ) ;
2017-04-11 08:09:01 -04:00
this . CookOutputDir = ParseParamValueIfNotSpecified ( Command , CookOutputDir , "CookOutputDir" , String . Empty , true ) ;
2016-11-21 20:27:58 -05:00
this . CookMapsOnly = GetParamValueIfNotSpecified ( Command , CookMapsOnly , this . CookMapsOnly , "CookMapsOnly" ) ;
2014-03-14 14:13:41 -04:00
this . FileServer = GetParamValueIfNotSpecified ( Command , FileServer , this . FileServer , "fileserver" ) ;
this . DedicatedServer = GetParamValueIfNotSpecified ( Command , DedicatedServer , this . DedicatedServer , "dedicatedserver" , "server" ) ;
this . Client = GetParamValueIfNotSpecified ( Command , Client , this . Client , "client" ) ;
2015-08-26 14:17:28 -04:00
/*if( this.Client )
2014-03-14 14:13:41 -04:00
{
this.DedicatedServer = true;
2015-08-26 14:17:28 -04:00
}*/
2014-03-14 14:13:41 -04:00
this . NoClient = GetParamValueIfNotSpecified ( Command , NoClient , this . NoClient , "noclient" ) ;
2019-09-13 13:29:44 -04:00
if ( Command ! = null )
{
if ( TargetNames = = null )
{
TargetNames = new List < string > ( ) ;
}
foreach ( string TargetParam in Command . ParseParamValues ( "target" ) )
{
TargetNames . AddRange ( TargetParam . Split ( '+' ) ) ;
}
}
2014-03-14 14:13:41 -04:00
this . LogWindow = GetParamValueIfNotSpecified ( Command , LogWindow , this . LogWindow , "logwindow" ) ;
2020-01-13 06:48:39 -05:00
string ExtraTargetsToStageWithClientString = null ;
ExtraTargetsToStageWithClientString = ParseParamValueIfNotSpecified ( Command , ExtraTargetsToStageWithClientString , "ExtraTargetsToStageWithClient" , null ) ;
if ( ! string . IsNullOrEmpty ( ExtraTargetsToStageWithClientString ) )
{
this . ExtraTargetsToStageWithClient = new ParamList < string > ( ExtraTargetsToStageWithClientString . Split ( '+' ) ) ;
}
2014-03-14 14:13:41 -04:00
this . Stage = GetParamValueIfNotSpecified ( Command , Stage , this . Stage , "stage" ) ;
this . SkipStage = GetParamValueIfNotSpecified ( Command , SkipStage , this . SkipStage , "skipstage" ) ;
if ( this . SkipStage )
{
this . Stage = true ;
}
2015-05-05 21:28:15 -04:00
this . StageDirectoryParam = ParseParamValueIfNotSpecified ( Command , StageDirectoryParam , "stagingdirectory" , String . Empty , true ) ;
2018-08-14 18:32:34 -04:00
this . bCodeSign = GetOptionalParamValueIfNotSpecified ( Command , CodeSign , CommandUtils . IsBuildMachine , "CodeSign" , "NoCodeSign" ) ;
2016-03-14 21:21:09 -04:00
this . bTreatNonShippingBinariesAsDebugFiles = GetParamValueIfNotSpecified ( Command , TreatNonShippingBinariesAsDebugFiles , false , "TreatNonShippingBinariesAsDebugFiles" ) ;
2018-02-22 11:25:06 -05:00
this . bUseExtraFlavor = GetParamValueIfNotSpecified ( Command , UseExtraFlavor , false , "UseExtraFlavor" ) ;
2014-03-14 14:13:41 -04:00
this . Manifests = GetParamValueIfNotSpecified ( Command , Manifests , this . Manifests , "manifests" ) ;
2014-10-27 19:33:51 -04:00
this . CreateChunkInstall = GetParamValueIfNotSpecified ( Command , CreateChunkInstall , this . CreateChunkInstall , "createchunkinstall" ) ;
2015-05-05 21:28:15 -04:00
this . ChunkInstallDirectory = ParseParamValueIfNotSpecified ( Command , ChunkInstallDirectory , "chunkinstalldirectory" , String . Empty , true ) ;
this . ChunkInstallVersionString = ParseParamValueIfNotSpecified ( Command , ChunkInstallVersionString , "chunkinstallversion" , String . Empty , true ) ;
2017-06-08 10:21:39 -04:00
this . ChunkInstallReleaseString = ParseParamValueIfNotSpecified ( Command , ChunkInstallReleaseString , "chunkinstallrelease" , String . Empty , true ) ;
if ( string . IsNullOrEmpty ( this . ChunkInstallReleaseString ) )
{
this . ChunkInstallReleaseString = this . ChunkInstallVersionString ;
}
2017-06-16 20:17:59 -04:00
this . Archive = GetParamValueIfNotSpecified ( Command , Archive , this . Archive , "archive" ) ;
2015-05-05 21:28:15 -04:00
this . ArchiveDirectoryParam = ParseParamValueIfNotSpecified ( Command , ArchiveDirectoryParam , "archivedirectory" , String . Empty , true ) ;
2014-10-24 11:50:48 -04:00
this . ArchiveMetaData = GetParamValueIfNotSpecified ( Command , ArchiveMetaData , this . ArchiveMetaData , "archivemetadata" ) ;
2015-07-29 17:47:13 -04:00
this . CreateAppBundle = GetParamValueIfNotSpecified ( Command , CreateAppBundle , true , "createappbundle" ) ;
2014-03-14 14:13:41 -04:00
this . Distribution = GetParamValueIfNotSpecified ( Command , Distribution , this . Distribution , "distribution" ) ;
2014-09-23 13:55:06 -04:00
this . Prereqs = GetParamValueIfNotSpecified ( Command , Prereqs , this . Prereqs , "prereqs" ) ;
2016-07-29 17:10:25 -04:00
this . AppLocalDirectory = ParseParamValueIfNotSpecified ( Command , AppLocalDirectory , "applocaldirectory" , String . Empty , true ) ;
2014-10-15 10:07:06 -04:00
this . NoBootstrapExe = GetParamValueIfNotSpecified ( Command , NoBootstrapExe , this . NoBootstrapExe , "nobootstrapexe" ) ;
2014-10-27 19:33:51 -04:00
this . Prebuilt = GetParamValueIfNotSpecified ( Command , Prebuilt , this . Prebuilt , "prebuilt" ) ;
if ( this . Prebuilt )
{
this . SkipCook = true ;
/*this.SkipPak = true;
this.SkipStage = true;
this.Pak = true;
this.Stage = true;*/
this . Cook = true ;
this . Archive = true ;
this . Deploy = true ;
this . Run = true ;
//this.StageDirectoryParam = this.PrebuiltDir;
}
this . NoDebugInfo = GetParamValueIfNotSpecified ( Command , NoDebugInfo , this . NoDebugInfo , "nodebuginfo" ) ;
2018-02-22 11:25:06 -05:00
this . SeparateDebugInfo = GetParamValueIfNotSpecified ( Command , SeparateDebugInfo , this . SeparateDebugInfo , "separatedebuginfo" ) ;
2017-05-03 14:18:32 -04:00
this . MapFile = GetParamValueIfNotSpecified ( Command , MapFile , this . MapFile , "mapfile" ) ;
2014-03-14 14:13:41 -04:00
this . NoCleanStage = GetParamValueIfNotSpecified ( Command , NoCleanStage , this . NoCleanStage , "nocleanstage" ) ;
this . MapToRun = ParseParamValueIfNotSpecified ( Command , MapToRun , "map" , String . Empty ) ;
2014-04-23 16:44:23 -04:00
this . AdditionalServerMapParams = ParseParamValueIfNotSpecified ( Command , AdditionalServerMapParams , "AdditionalServerMapParams" , String . Empty ) ;
2014-03-14 14:13:41 -04:00
this . Foreign = GetParamValueIfNotSpecified ( Command , Foreign , this . Foreign , "foreign" ) ;
this . ForeignCode = GetParamValueIfNotSpecified ( Command , ForeignCode , this . ForeignCode , "foreigncode" ) ;
this . StageCommandline = ParseParamValueIfNotSpecified ( Command , StageCommandline , "cmdline" ) ;
this . BundleName = ParseParamValueIfNotSpecified ( Command , BundleName , "bundlename" ) ;
this . RunCommandline = ParseParamValueIfNotSpecified ( Command , RunCommandline , "addcmdline" ) ;
2015-09-17 10:55:35 -04:00
this . RunCommandline = this . RunCommandline . Replace ( '\'' , '\"' ) ; // replace any single quotes with double quotes
2016-09-01 21:20:38 -04:00
this . ServerCommandline = ParseParamValueIfNotSpecified ( Command , ServerCommandline , "servercmdline" ) ;
this . ServerCommandline = this . ServerCommandline . Replace ( '\'' , '\"' ) ; // replace any single quotes with double quotes
2017-05-09 17:15:32 -04:00
this . ClientCommandline = ParseParamValueIfNotSpecified ( Command , ClientCommandline , "clientcmdline" ) ;
this . ClientCommandline = this . ClientCommandline . Replace ( '\'' , '\"' ) ; // replace any single quotes with double quotes
2016-09-01 21:20:38 -04:00
this . Package = GetParamValueIfNotSpecified ( Command , Package , this . Package , "package" ) ;
2020-04-10 11:30:32 -04:00
this . SkipPackage = GetParamValueIfNotSpecified ( Command , SkipPackage , this . SkipPackage , "skippackage" ) ;
2018-02-22 11:25:06 -05:00
this . ForcePackageData = GetParamValueIfNotSpecified ( Command , Package , this . ForcePackageData , "forcepackagedata" ) ;
2016-11-20 21:35:35 -05:00
2014-03-14 14:13:41 -04:00
this . Deploy = GetParamValueIfNotSpecified ( Command , Deploy , this . Deploy , "deploy" ) ;
2016-11-20 21:35:35 -05:00
this . DeployFolder = ParseParamValueIfNotSpecified ( Command , DeployFolder , "deploy" , null ) ;
// if the user specified -deploy but no folder, set the default
if ( this . Deploy & & string . IsNullOrEmpty ( this . DeployFolder ) )
{
2020-01-17 04:36:41 -05:00
this . DeployFolder = UnrealBuildTool . DeployExports . GetDefaultDeployFolder ( this . ShortProjectName ) ;
2016-11-20 21:35:35 -05:00
}
else if ( string . IsNullOrEmpty ( this . DeployFolder ) = = false )
{
// if the user specified a folder set deploy to true.
//@todo - remove 'deploy' var and check deployfolder != null?
this . Deploy = true ;
}
2018-04-03 15:23:51 -04:00
this . GetFile = ParseParamValueIfNotSpecified ( Command , GetFile , "getfile" , null ) ;
2015-02-09 16:23:03 -05:00
this . IterativeDeploy = GetParamValueIfNotSpecified ( Command , IterativeDeploy , this . IterativeDeploy , new string [ ] { "iterativedeploy" , "iterate" } ) ;
2015-06-09 10:11:45 -04:00
this . FastCook = GetParamValueIfNotSpecified ( Command , FastCook , this . FastCook , "FastCook" ) ;
this . IgnoreCookErrors = GetParamValueIfNotSpecified ( Command , IgnoreCookErrors , this . IgnoreCookErrors , "IgnoreCookErrors" ) ;
2017-10-24 10:14:07 -04:00
// Determine whether or not we're going to nativize Blueprint assets at cook time.
this . RunAssetNativization = false ;
ConfigHierarchy GameIni = ConfigCache . ReadHierarchy ( ConfigHierarchyType . Game , RawProjectPath . Directory , HostPlatform . Current . HostEditorPlatform ) ;
if ( GameIni ! = null )
{
string BlueprintNativizationMethod ;
if ( GameIni . TryGetValue ( "/Script/UnrealEd.ProjectPackagingSettings" , "BlueprintNativizationMethod" , out BlueprintNativizationMethod ) )
{
this . RunAssetNativization = ! string . IsNullOrEmpty ( BlueprintNativizationMethod ) & & BlueprintNativizationMethod ! = "Disabled" ;
}
}
2014-12-18 17:37:28 -05:00
2016-07-19 19:13:01 -04:00
string DeviceString = ParseParamValueIfNotSpecified ( Command , Device , "device" , String . Empty ) . Trim ( new char [ ] { '\"' } ) ;
if ( DeviceString = = "" )
{
2018-09-12 15:59:49 -04:00
this . Devices = new ParamList < string > ( "" ) ;
this . DeviceNames = new ParamList < string > ( "" ) ;
2016-07-19 19:13:01 -04:00
}
else
{
2018-10-05 11:15:17 -04:00
this . Devices = new ParamList < string > ( DeviceString . Split ( new char [ ] { '+' } , StringSplitOptions . RemoveEmptyEntries ) ) ;
2016-07-19 19:13:01 -04:00
this . DeviceNames = new ParamList < string > ( ) ;
foreach ( var d in this . Devices )
{
// strip the platform prefix the specified device.
if ( d . Contains ( "@" ) )
{
this . DeviceNames . Add ( d . Substring ( d . IndexOf ( "@" ) + 1 ) ) ;
}
else
{
this . DeviceNames . Add ( d ) ;
}
}
}
2014-12-18 17:37:28 -05:00
2015-09-18 13:42:25 -04:00
this . Provision = ParseParamValueIfNotSpecified ( Command , Provision , "provision" , String . Empty , true ) ;
2015-10-02 14:24:38 -04:00
this . Certificate = ParseParamValueIfNotSpecified ( Command , Certificate , "certificate" , String . Empty , true ) ;
2017-04-11 10:32:07 -04:00
this . Team = ParseParamValueIfNotSpecified ( Command , Team , "team" , String . Empty , true ) ;
this . AutomaticSigning = GetParamValueIfNotSpecified ( Command , AutomaticSigning , this . AutomaticSigning , "AutomaticSigning" ) ;
2015-09-18 13:42:25 -04:00
2016-07-19 19:13:01 -04:00
this . ServerDevice = ParseParamValueIfNotSpecified ( Command , ServerDevice , "serverdevice" , this . Devices . Count > 0 ? this . Devices [ 0 ] : "" ) ;
2014-03-14 14:13:41 -04:00
this . NullRHI = GetParamValueIfNotSpecified ( Command , NullRHI , this . NullRHI , "nullrhi" ) ;
this . FakeClient = GetParamValueIfNotSpecified ( Command , FakeClient , this . FakeClient , "fakeclient" ) ;
this . EditorTest = GetParamValueIfNotSpecified ( Command , EditorTest , this . EditorTest , "editortest" ) ;
2014-10-27 19:33:51 -04:00
this . RunAutomationTest = ParseParamValueIfNotSpecified ( Command , RunAutomationTest , "RunAutomationTest" ) ;
this . RunAutomationTests = this . RunAutomationTest ! = "" | | GetParamValueIfNotSpecified ( Command , RunAutomationTests , this . RunAutomationTests , "RunAutomationTests" ) ;
this . SkipServer = GetParamValueIfNotSpecified ( Command , SkipServer , this . SkipServer , "skipserver" ) ;
2020-09-10 15:39:00 -04:00
this . UE4Exe = ParseParamValueIfNotSpecified ( Command , UE4Exe , "ue4exe" , "UnrealEditor-Cmd.exe" ) ;
2014-03-14 14:13:41 -04:00
this . Unattended = GetParamValueIfNotSpecified ( Command , Unattended , this . Unattended , "unattended" ) ;
this . DeviceUsername = ParseParamValueIfNotSpecified ( Command , DeviceUsername , "deviceuser" , String . Empty ) ;
this . DevicePassword = ParseParamValueIfNotSpecified ( Command , DevicePassword , "devicepass" , String . Empty ) ;
this . CrashReporter = GetParamValueIfNotSpecified ( Command , CrashReporter , this . CrashReporter , "crashreporter" ) ;
2015-05-13 12:27:09 -04:00
this . SpecifiedArchitecture = ParseParamValueIfNotSpecified ( Command , SpecifiedArchitecture , "specifiedarchitecture" , String . Empty ) ;
2018-02-22 11:25:06 -05:00
this . UbtArgs = ParseParamValueIfNotSpecified ( Command , UbtArgs , "ubtargs" , String . Empty ) ;
2018-11-14 19:05:13 -05:00
this . AdditionalPackageOptions = ParseParamValueIfNotSpecified ( Command , AdditionalPackageOptions , "AdditionalPackageOptions" , String . Empty ) ;
2015-09-02 17:26:25 -04:00
2014-03-14 14:13:41 -04:00
if ( ClientConfigsToBuild = = null )
{
if ( Command ! = null )
{
2019-06-10 11:58:40 -04:00
string ClientConfig = Command . ParseParamValue ( "clientconfig" ) ;
2016-06-28 17:59:42 -04:00
if ( ClientConfig = = null )
ClientConfig = Command . ParseParamValue ( "config" ) ;
2019-08-05 12:03:51 -04:00
if ( ClientConfig = = null )
ClientConfig = Command . ParseParamValue ( "configuration" ) ;
if ( ClientConfig ! = null )
2014-03-14 14:13:41 -04:00
{
this . ClientConfigsToBuild = new List < UnrealTargetConfiguration > ( ) ;
2019-06-10 11:58:40 -04:00
ParamList < string > Configs = new ParamList < string > ( ClientConfig . Split ( new char [ ] { '+' } , StringSplitOptions . RemoveEmptyEntries ) ) ;
foreach ( string ConfigName in Configs )
2014-03-14 14:13:41 -04:00
{
2019-06-10 11:58:40 -04:00
this . ClientConfigsToBuild . Add ( ParseConfig ( ConfigName ) ) ;
2014-03-14 14:13:41 -04:00
}
}
}
}
else
{
this . ClientConfigsToBuild = ClientConfigsToBuild ;
}
2014-07-07 17:14:45 -04:00
2014-10-27 19:33:51 -04:00
if ( Port = = null )
{
if ( Command ! = null )
{
this . Port = new ParamList < string > ( ) ;
2014-07-07 17:14:45 -04:00
2014-10-27 19:33:51 -04:00
var PortString = Command . ParseParamValue ( "port" ) ;
if ( String . IsNullOrEmpty ( PortString ) = = false )
{
2018-10-05 11:15:17 -04:00
var Ports = new ParamList < string > ( PortString . Split ( new char [ ] { '+' } , StringSplitOptions . RemoveEmptyEntries ) ) ;
2014-10-27 19:33:51 -04:00
foreach ( var P in Ports )
{
this . Port . Add ( P ) ;
}
}
}
}
else
{
this . Port = Port ;
}
2014-07-07 17:14:45 -04:00
2015-02-04 16:18:11 -05:00
if ( MapsToCook = = null )
{
if ( Command ! = null )
{
this . MapsToCook = new ParamList < string > ( ) ;
var MapsString = Command . ParseParamValue ( "MapsToCook" ) ;
if ( String . IsNullOrEmpty ( MapsString ) = = false )
{
2018-10-05 11:15:17 -04:00
var MapNames = new ParamList < string > ( MapsString . Split ( new char [ ] { '+' } , StringSplitOptions . RemoveEmptyEntries ) ) ;
2015-02-04 16:18:11 -05:00
foreach ( var M in MapNames )
{
this . MapsToCook . Add ( M ) ;
}
}
}
}
else
{
this . MapsToCook = MapsToCook ;
}
2017-01-27 23:32:44 -05:00
if ( MapIniSectionsToCook = = null )
{
if ( Command ! = null )
{
this . MapIniSectionsToCook = new ParamList < string > ( ) ;
var MapsString = Command . ParseParamValue ( "MapIniSectionsToCook" ) ;
if ( String . IsNullOrEmpty ( MapsString ) = = false )
{
2018-10-05 11:15:17 -04:00
var MapNames = new ParamList < string > ( MapsString . Split ( new char [ ] { '+' } , StringSplitOptions . RemoveEmptyEntries ) ) ;
2017-01-27 23:32:44 -05:00
foreach ( var M in MapNames )
{
this . MapIniSectionsToCook . Add ( M ) ;
}
}
}
}
else
{
this . MapIniSectionsToCook = MapIniSectionsToCook ;
}
if ( String . IsNullOrEmpty ( this . MapToRun ) = = false )
2015-02-13 15:29:05 -05:00
{
this . MapsToCook . Add ( this . MapToRun ) ;
}
2015-09-29 10:04:26 -04:00
if ( InMapsToRebuildLightMaps = = null )
{
if ( Command ! = null )
{
this . MapsToRebuildLightMaps = new ParamList < string > ( ) ;
var MapsString = Command . ParseParamValue ( "MapsToRebuildLightMaps" ) ;
if ( String . IsNullOrEmpty ( MapsString ) = = false )
{
2018-10-05 11:15:17 -04:00
var MapNames = new ParamList < string > ( MapsString . Split ( new char [ ] { '+' } , StringSplitOptions . RemoveEmptyEntries ) ) ;
2015-09-29 10:04:26 -04:00
foreach ( var M in MapNames )
{
this . MapsToRebuildLightMaps . Add ( M ) ;
}
}
}
}
else
{
this . MapsToRebuildLightMaps = InMapsToRebuildLightMaps ;
}
2015-12-08 09:25:02 -05:00
2018-02-22 11:25:06 -05:00
if ( InMapsToRebuildHLOD = = null )
{
if ( Command ! = null )
{
this . MapsToRebuildHLODMaps = new ParamList < string > ( ) ;
var MapsString = Command . ParseParamValue ( "MapsToRebuildHLODMaps" ) ;
if ( String . IsNullOrEmpty ( MapsString ) = = false )
{
2018-10-05 11:15:17 -04:00
var MapNames = new ParamList < string > ( MapsString . Split ( new char [ ] { '+' } , StringSplitOptions . RemoveEmptyEntries ) ) ;
2018-02-22 11:25:06 -05:00
foreach ( var M in MapNames )
{
this . MapsToRebuildHLODMaps . Add ( M ) ;
}
}
}
}
else
{
this . MapsToRebuildHLODMaps = InMapsToRebuildHLOD ;
}
if ( TitleID = = null )
2015-12-08 09:25:02 -05:00
{
if ( Command ! = null )
{
this . TitleID = new ParamList < string > ( ) ;
var TitleString = Command . ParseParamValue ( "TitleID" ) ;
if ( String . IsNullOrEmpty ( TitleString ) = = false )
{
2018-10-05 11:15:17 -04:00
var TitleIDs = new ParamList < string > ( TitleString . Split ( new char [ ] { '+' } , StringSplitOptions . RemoveEmptyEntries ) ) ;
2015-12-08 09:25:02 -05:00
foreach ( var T in TitleIDs )
{
this . TitleID . Add ( T ) ;
}
}
}
}
else
{
this . TitleID = TitleID ;
}
2014-03-14 14:13:41 -04:00
if ( ServerConfigsToBuild = = null )
{
if ( Command ! = null )
{
2019-06-10 11:58:40 -04:00
string ServerConfig = Command . ParseParamValue ( "serverconfig" ) ;
2016-06-28 17:59:42 -04:00
if ( ServerConfig = = null )
ServerConfig = Command . ParseParamValue ( "config" ) ;
2019-08-05 12:03:51 -04:00
if ( ServerConfig = = null )
ServerConfig = Command . ParseParamValue ( "configuration" ) ;
if ( ServerConfig ! = null )
2014-03-14 14:13:41 -04:00
{
this . ServerConfigsToBuild = new List < UnrealTargetConfiguration > ( ) ;
2019-06-10 11:58:40 -04:00
ParamList < string > Configs = new ParamList < string > ( ServerConfig . Split ( new char [ ] { '+' } , StringSplitOptions . RemoveEmptyEntries ) ) ;
foreach ( string ConfigName in Configs )
2014-03-14 14:13:41 -04:00
{
2019-06-10 11:58:40 -04:00
this . ServerConfigsToBuild . Add ( ParseConfig ( ConfigName ) ) ;
2014-03-14 14:13:41 -04:00
}
}
}
}
else
{
this . ServerConfigsToBuild = ServerConfigsToBuild ;
}
if ( NumClients . HasValue )
{
this . NumClients = NumClients . Value ;
}
else if ( Command ! = null )
{
this . NumClients = Command . ParseParamInt ( "numclients" ) ;
}
2014-10-27 19:33:51 -04:00
if ( CrashIndex . HasValue )
{
this . CrashIndex = CrashIndex . Value ;
}
else if ( Command ! = null )
{
this . CrashIndex = Command . ParseParamInt ( "CrashIndex" ) ;
}
if ( RunTimeoutSeconds . HasValue )
{
this . RunTimeoutSeconds = RunTimeoutSeconds . Value ;
}
else if ( Command ! = null )
{
this . RunTimeoutSeconds = Command . ParseParamInt ( "runtimeoutseconds" ) ;
}
2014-03-14 14:13:41 -04:00
2017-10-24 10:14:07 -04:00
// Gather up any '-ini:' arguments and save them. We'll pass these along to other tools that may be spawned in a new process as part of the command.
2017-11-08 10:59:53 -05:00
if ( Command ! = null )
2017-10-24 10:14:07 -04:00
{
2017-11-08 10:59:53 -05:00
foreach ( string Param in Command . Params )
2017-10-24 10:14:07 -04:00
{
2017-11-08 10:59:53 -05:00
if ( Param . StartsWith ( "ini:" , StringComparison . InvariantCultureIgnoreCase ) )
{
this . ConfigOverrideParams . Add ( Param ) ;
}
2017-10-24 10:14:07 -04:00
}
}
2014-03-14 14:13:41 -04:00
AutodetectSettings ( false ) ;
ValidateAndLog ( ) ;
2018-02-22 11:25:06 -05:00
if ( this . PrePak )
{
if ( ! CommandUtils . P4Enabled )
{
throw new AutomationException ( "-PrePak requires -P4" ) ;
}
if ( CommandUtils . P4Env . Changelist < 1000 )
{
throw new AutomationException ( "-PrePak requires a CL from P4 and we have {0}" , CommandUtils . P4Env . Changelist ) ;
}
2014-03-14 14:13:41 -04:00
2018-02-22 11:25:06 -05:00
string SrcBuildPath = CommandUtils . CombinePaths ( CommandUtils . RootBuildStorageDirectory ( ) , ShortProjectName ) ;
string SrcBuildPath2 = CommandUtils . CombinePaths ( CommandUtils . RootBuildStorageDirectory ( ) , ShortProjectName . Replace ( "Game" , "" ) . Replace ( "game" , "" ) ) ;
2014-03-14 14:13:41 -04:00
2018-02-22 11:25:06 -05:00
if ( ! InternalUtils . SafeDirectoryExists ( SrcBuildPath ) )
{
if ( ! InternalUtils . SafeDirectoryExists ( SrcBuildPath2 ) )
{
throw new AutomationException ( "PrePak: Neither {0} nor {1} exists." , SrcBuildPath , SrcBuildPath2 ) ;
}
SrcBuildPath = SrcBuildPath2 ;
}
string SrcCLPath = CommandUtils . CombinePaths ( SrcBuildPath , CommandUtils . EscapePath ( CommandUtils . P4Env . Branch ) + "-CL-" + CommandUtils . P4Env . Changelist . ToString ( ) ) ;
if ( ! InternalUtils . SafeDirectoryExists ( SrcCLPath ) )
{
throw new AutomationException ( "PrePak: {0} does not exist." , SrcCLPath ) ;
}
}
}
2014-03-14 14:13:41 -04:00
2019-06-10 11:58:40 -04:00
static UnrealTargetConfiguration ParseConfig ( string ConfigName )
{
UnrealTargetConfiguration ConfigValue ;
if ( ! Enum . TryParse ( ConfigName , true , out ConfigValue ) )
{
throw new AutomationException ( "Invalid configuration '{0}'. Valid configurations are '{1}'." , ConfigName , String . Join ( "', '" , Enum . GetNames ( typeof ( UnrealTargetConfiguration ) ) . Where ( x = > x ! = nameof ( UnrealTargetConfiguration . Unknown ) ) ) ) ;
}
return ConfigValue ;
}
2018-02-22 11:25:06 -05:00
2019-06-10 11:58:40 -04:00
/// <summary>
/// Shared: Full path to the .uproject file
/// </summary>
public FileReference RawProjectPath { private set ; get ; }
2014-03-14 14:13:41 -04:00
/// <summary>
/// Shared: The current project is a foreign project, commandline: -foreign
/// </summary>
[Help("foreign", "Generate a foreign uproject from blankproject and use that")]
public bool Foreign { private set ; get ; }
/// <summary>
/// Shared: The current project is a foreign project, commandline: -foreign
/// </summary>
[Help("foreigncode", "Generate a foreign code uproject from platformergame and use that")]
public bool ForeignCode { private set ; get ; }
/// <summary>
2016-01-11 10:12:46 -05:00
/// Shared: true if we should build crash reporter
2014-03-14 14:13:41 -04:00
/// </summary>
[Help("CrashReporter", "true if we should build crash reporter")]
public bool CrashReporter { private set ; get ; }
/// <summary>
/// Shared: Determines if the build is going to use cooked data, commandline: -cook, -cookonthefly
/// </summary>
[Help("cook, -cookonthefly", "Determines if the build is going to use cooked data")]
public bool Cook { private set ; get ; }
/// <summary>
/// Shared: Determines if the build is going to use cooked data, commandline: -cook, -cookonthefly
/// </summary>
[Help("skipcook", "use a cooked build, but we assume the cooked data is up to date and where it belongs, implies -cook")]
public bool SkipCook { private set ; get ; }
/// <summary>
/// Shared: In a cookonthefly build, used solely to pass information to the package step. This is necessary because you can't set cookonthefly and cook at the same time, and skipcook sets cook.
/// </summary>
[Help("skipcookonthefly", "in a cookonthefly build, used solely to pass information to the package step")]
public bool SkipCookOnTheFly { private set ; get ; }
/// <summary>
/// Shared: Determines if the intermediate folders will be wiped before building, commandline: -clean
/// </summary>
[Help("clean", "wipe intermediate folders before building")]
public bool? Clean { private set ; get ; }
/// <summary>
/// Shared: Assumes no user is sitting at the console, so for example kills clients automatically, commandline: -Unattended
/// </summary>
[Help("unattended", "assumes no operator is present, always terminates without waiting for something.")]
public bool Unattended { private set ; get ; }
/// <summary>
2014-10-27 19:33:51 -04:00
/// Shared: Sets platforms to build for non-dedicated servers. commandline: -TargetPlatform
2014-03-14 14:13:41 -04:00
/// </summary>
2016-07-19 19:13:01 -04:00
public List < TargetPlatformDescriptor > ClientTargetPlatforms = new List < TargetPlatformDescriptor > ( ) ;
2014-03-14 14:13:41 -04:00
2014-10-27 19:33:51 -04:00
/// <summary>
/// Shared: Dictionary that maps client dependent platforms to "source" platforms that it should copy data from. commandline: -TargetPlatform=source.dependent
/// </summary>
2016-07-19 19:13:01 -04:00
public Dictionary < TargetPlatformDescriptor , TargetPlatformDescriptor > ClientDependentPlatformMap = new Dictionary < TargetPlatformDescriptor , TargetPlatformDescriptor > ( ) ;
2014-08-18 13:29:39 -04:00
2014-03-14 14:13:41 -04:00
/// <summary>
2014-10-27 19:33:51 -04:00
/// Shared: Sets platforms to build for dedicated servers. commandline: -ServerTargetPlatform
2014-03-14 14:13:41 -04:00
/// </summary>
2016-07-19 19:13:01 -04:00
public List < TargetPlatformDescriptor > ServerTargetPlatforms = new List < TargetPlatformDescriptor > ( ) ;
2014-03-14 14:13:41 -04:00
2014-10-27 19:33:51 -04:00
/// <summary>
/// Shared: Dictionary that maps server dependent platforms to "source" platforms that it should copy data from: -ServerTargetPlatform=source.dependent
/// </summary>
2016-07-19 19:13:01 -04:00
public Dictionary < TargetPlatformDescriptor , TargetPlatformDescriptor > ServerDependentPlatformMap = new Dictionary < TargetPlatformDescriptor , TargetPlatformDescriptor > ( ) ;
2014-08-18 13:29:39 -04:00
2014-03-14 14:13:41 -04:00
/// <summary>
/// Shared: True if pak file should be generated.
/// </summary>
[Help("pak", "generate a pak file")]
public bool Pak { private set ; get ; }
2020-02-24 20:18:28 -05:00
/// <summary>
2020-02-27 20:59:51 -05:00
/// Stage: True if we should disable trying to re-use pak files from another staged build when we've specified a different cook source platform
2020-02-24 20:18:28 -05:00
/// </summary>
2020-02-27 20:59:51 -05:00
[Help("pak", "disable reuse of pak files from the alternate cook source folder, if specified")]
public bool IgnorePaksFromDifferentCookSource { get ; private set ; }
2020-02-24 20:18:28 -05:00
2019-11-25 12:03:09 -05:00
/// <summary>
/// Shared: True if container file(s) should be generated with ZenPak.
/// </summary>
[Help("iostore", "generate I/O store container file(s)")]
public bool IoStore { private set ; get ; }
2014-09-26 15:27:39 -04:00
/// <summary>
///
/// </summary>
public bool UsePak ( Platform PlatformToCheck )
{
return Pak | | PlatformToCheck . RequiresPak ( this ) = = Platform . PakType . Always ;
}
2016-03-13 18:53:13 -04:00
private string SignPakInternal { get ; set ; }
2014-03-14 14:13:41 -04:00
/// <summary>
/// Shared: Encryption keys used for signing the pak file.
/// </summary>
[Help("signpak=keys", "sign the generated pak file with the specified key, i.e. -signpak=C:\\Encryption.keys. Also implies -signedpak.")]
2016-03-13 18:53:13 -04:00
public string SignPak
{
private set
{
if ( string . IsNullOrEmpty ( value ) | | value . StartsWith ( "0x" , StringComparison . InvariantCultureIgnoreCase ) )
{
SignPakInternal = value ;
}
else
{
SignPakInternal = Path . GetFullPath ( value ) ;
}
}
get
{
return SignPakInternal ;
}
}
2014-03-14 14:13:41 -04:00
2018-02-22 11:25:06 -05:00
/// <summary>
/// Shared: true if this build is staged, command line: -stage
/// </summary>
[Help("prepak", "attempt to avoid cooking and instead pull pak files from the network, implies pak and skipcook")]
public bool PrePak { private set ; get ; }
/// <summary>
/// Shared: the game will use only signed content.
/// </summary>
[Help("signed", "the game should expect to use a signed pak file.")]
2014-03-14 14:13:41 -04:00
public bool SignedPak { private set ; get ; }
2019-02-12 10:27:29 -05:00
/// <summary>
/// Shared: The game will be set up for memory mapping bulk data.
/// </summary>
[Help("PakAlignForMemoryMapping", "The game will be set up for memory mapping bulk data.")]
public bool PakAlignForMemoryMapping { private set ; get ; }
2014-03-14 14:13:41 -04:00
/// <summary>
/// Shared: true if this build is staged, command line: -stage
/// </summary>
[Help("skippak", "use a pak file, but assume it is already built, implies pak")]
public bool SkipPak { private set ; get ; }
2020-02-06 13:13:41 -05:00
/// <summary>
/// Shared: true if we want to skip iostore, even if -iostore is specified
/// </summary>
[Help("skipiostore", "override the -iostore commandline option to not run it")]
public bool SkipIoStore { private set ; get ; }
2014-03-14 14:13:41 -04:00
/// <summary>
/// Shared: true if this build is staged, command line: -stage
/// </summary>
[Help("stage", "put this build in a stage directory")]
public bool Stage { private set ; get ; }
/// <summary>
/// Shared: true if this build is staged, command line: -stage
/// </summary>
[Help("skipstage", "uses a stage directory, but assumes everything is already there, implies -stage")]
public bool SkipStage { private set ; get ; }
/// <summary>
/// Shared: true if this build is using streaming install manifests, command line: -manifests
/// </summary>
[Help("manifests", "generate streaming install manifests when cooking data")]
public bool Manifests { private set ; get ; }
2014-10-27 19:33:51 -04:00
/// <summary>
2015-04-02 04:22:48 -04:00
/// Shared: true if this build chunk install streaming install data, command line: -createchunkinstalldata
2014-10-27 19:33:51 -04:00
/// </summary>
[Help("createchunkinstall", "generate streaming install data from manifest when cooking data, requires -stage & -manifests")]
public bool CreateChunkInstall { private set ; get ; }
2014-08-01 11:07:46 -04:00
2015-04-02 04:22:48 -04:00
/// <summary>
/// Shared: Directory to use for built chunk install data, command line: -chunkinstalldirectory=
/// </summary>
public string ChunkInstallDirectory { set ; get ; }
/// <summary>
/// Shared: Version string to use for built chunk install data, command line: -chunkinstallversion=
/// </summary>
public string ChunkInstallVersionString { set ; get ; }
2017-06-16 20:17:59 -04:00
/// <summary>
2017-06-08 10:21:39 -04:00
/// Shared: Release string to use for built chunk install data, command line: -chunkinstallrelease=
/// </summary>
public string ChunkInstallReleaseString { set ; get ; }
/// <summary>
2017-06-16 20:17:59 -04:00
/// Shared: Directory to copy the client to, command line: -stagingdirectory=
/// </summary>
public string BaseStageDirectory
2014-03-14 14:13:41 -04:00
{
get
{
2014-12-17 10:00:26 -05:00
if ( ! String . IsNullOrEmpty ( StageDirectoryParam ) )
{
return Path . GetFullPath ( StageDirectoryParam ) ;
}
if ( HasDLCName )
{
2017-07-21 12:42:36 -04:00
return Path . GetFullPath ( CommandUtils . CombinePaths ( DLCFile . Directory . FullName , "Saved" , "StagedBuilds" ) ) ;
2014-12-17 10:00:26 -05:00
}
// default return the project saved\stagedbuilds directory
2015-09-26 14:41:15 -04:00
return Path . GetFullPath ( CommandUtils . CombinePaths ( Path . GetDirectoryName ( RawProjectPath . FullName ) , "Saved" , "StagedBuilds" ) ) ;
2014-03-14 14:13:41 -04:00
}
}
[Help("stagingdirectory=Path", "Directory to copy the builds to, i.e. -stagingdirectory=C:\\Stage")]
public string StageDirectoryParam ;
2015-09-25 14:24:14 -04:00
2020-09-10 15:39:00 -04:00
[Help("ue4exe=ExecutableName", "Name of the UE4 Editor executable, i.e. -ue4exe=UnrealEditor.exe")]
2014-03-14 14:13:41 -04:00
public string UE4Exe ;
/// <summary>
/// Shared: true if this build is archived, command line: -archive
/// </summary>
[Help("archive", "put this build in an archive directory")]
public bool Archive { private set ; get ; }
/// <summary>
/// Shared: Directory to archive the client to, command line: -archivedirectory=
/// </summary>
public string BaseArchiveDirectory
{
get
{
2015-09-26 14:41:15 -04:00
return Path . GetFullPath ( String . IsNullOrEmpty ( ArchiveDirectoryParam ) ? CommandUtils . CombinePaths ( Path . GetDirectoryName ( RawProjectPath . FullName ) , "ArchivedBuilds" ) : ArchiveDirectoryParam ) ;
2014-03-14 14:13:41 -04:00
}
}
[Help("archivedirectory=Path", "Directory to archive the builds to, i.e. -archivedirectory=C:\\Archive")]
public string ArchiveDirectoryParam ;
2014-10-24 11:50:48 -04:00
/// <summary>
/// Whether the project should use non monolithic staging
/// </summary>
[Help("archivemetadata", "Archive extra metadata files in addition to the build (e.g. build.properties)")]
public bool ArchiveMetaData ;
2015-07-29 17:47:13 -04:00
/// <summary>
/// When archiving for Mac, set this to true to package it in a .app bundle instead of normal loose files
/// </summary>
[Help("createappbundle", "When archiving for Mac, set this to true to package it in a .app bundle instead of normal loose files")]
public bool CreateAppBundle ;
2015-11-25 18:47:20 -05:00
/// <summary>
/// Determines if Blueprint assets should be substituted with auto-generated code.
/// </summary>
public bool RunAssetNativization ;
2017-10-24 10:14:07 -04:00
/// <summary>
/// Keeps track of any '-ini:type:[section]:value' arguments on the command line. These will override cached config settings for the current process, and can be passed along to other tools.
/// </summary>
public List < string > ConfigOverrideParams = new List < string > ( ) ;
2015-09-29 15:29:44 -04:00
2016-07-08 14:59:19 -04:00
/// <summary>
/// Build: True if build step should be executed, command: -build
/// </summary>
[Help("build", "True if build step should be executed")]
2014-03-14 14:13:41 -04:00
public bool Build { private set ; get ; }
2017-05-16 13:13:20 -04:00
/// <summary>
/// SkipBuildClient if true then don't build the client exe
/// </summary>
public bool SkipBuildClient { private set ; get ; }
/// <summary>
/// SkipBuildEditor if true then don't build the editor exe
/// </summary>
public bool SkipBuildEditor { private set ; get ; }
2014-03-14 14:13:41 -04:00
/// <summary>
/// Build: True if XGE should NOT be used for building.
/// </summary>
[Help("noxge", "True if XGE should NOT be used for building")]
public bool NoXGE { private set ; get ; }
/// <summary>
2018-08-20 13:55:11 -04:00
/// Build: List of editor build targets.
2014-03-14 14:13:41 -04:00
/// </summary>
private ParamList < string > EditorTargetsList = null ;
public ParamList < string > EditorTargets
{
set { EditorTargetsList = value ; }
get
{
if ( EditorTargetsList = = null )
{
// Lazy auto-initialization
AutodetectSettings ( false ) ;
}
return EditorTargetsList ;
}
}
/// <summary>
2018-08-20 13:55:11 -04:00
/// Build: List of program build targets.
2014-03-14 14:13:41 -04:00
/// </summary>
private ParamList < string > ProgramTargetsList = null ;
public ParamList < string > ProgramTargets
{
set { ProgramTargetsList = value ; }
get
{
if ( ProgramTargetsList = = null )
{
// Lazy auto-initialization
AutodetectSettings ( false ) ;
}
return ProgramTargetsList ;
}
}
/// <summary>
/// Build: List of client configurations
/// </summary>
public List < UnrealTargetConfiguration > ClientConfigsToBuild = new List < UnrealTargetConfiguration > ( ) { UnrealTargetConfiguration . Development } ;
///<summary>
/// Build: List of Server configurations
/// </summary>
public List < UnrealTargetConfiguration > ServerConfigsToBuild = new List < UnrealTargetConfiguration > ( ) { UnrealTargetConfiguration . Development } ;
/// <summary>
/// Build: List of client cooked build targets.
/// </summary>
private ParamList < string > ClientCookedTargetsList = null ;
public ParamList < string > ClientCookedTargets
{
set { ClientCookedTargetsList = value ; }
get
{
if ( ClientCookedTargetsList = = null )
{
// Lazy auto-initialization
AutodetectSettings ( false ) ;
}
return ClientCookedTargetsList ;
}
}
/// <summary>
/// Build: List of Server cooked build targets.
/// </summary>
private ParamList < string > ServerCookedTargetsList = null ;
public ParamList < string > ServerCookedTargets
{
set { ServerCookedTargetsList = value ; }
get
{
if ( ServerCookedTargetsList = = null )
{
// Lazy auto-initialization
AutodetectSettings ( false ) ;
}
return ServerCookedTargetsList ;
}
}
2018-08-20 13:55:11 -04:00
/// <summary>
2019-09-13 13:29:44 -04:00
/// Build: Specifies the names of targets to build
2018-08-20 13:55:11 -04:00
/// </summary>
2019-09-13 13:29:44 -04:00
private List < string > TargetNames ;
2018-08-20 13:55:11 -04:00
2014-03-14 14:13:41 -04:00
/// <summary>
/// Cook: List of maps to cook.
/// </summary>
public ParamList < string > MapsToCook = new ParamList < string > ( ) ;
2017-01-27 23:32:44 -05:00
/// <summary>
/// Cook: List of map inisections to cook (see allmaps)
/// </summary>
public ParamList < string > MapIniSectionsToCook = new ParamList < string > ( ) ;
2014-03-14 14:13:41 -04:00
/// <summary>
/// Cook: List of directories to cook.
/// </summary>
public ParamList < string > DirectoriesToCook = new ParamList < string > ( ) ;
2020-09-24 00:43:27 -04:00
/// <summary>
/// Cook: Which ddc graph to use when cooking.
/// </summary>
public string DDCGraph ;
2014-10-27 19:33:51 -04:00
/// <summary>
/// Cook: Internationalization preset to cook.
/// </summary>
public string InternationalizationPreset ;
2014-08-14 16:53:33 -04:00
2014-12-15 11:35:52 -05:00
/// <summary>
2015-09-09 09:35:59 -04:00
/// Cook: Create a cooked release version. Also, the version. e.g. 1.0
2014-12-15 11:35:52 -05:00
/// </summary>
public string CreateReleaseVersion ;
2017-11-09 18:22:55 -05:00
/// <summary>
2016-11-21 20:27:58 -05:00
/// Cook: While cooking clean up packages as we go along rather then cleaning everything (and potentially having to reload some of it) when we run out of space
/// </summary>
[Help("CookPartialgc", "while cooking clean up packages as we are done with them rather then cleaning everything up when we run out of space")]
public bool CookPartialGC { private set ; get ; }
/// <summary>
/// Stage: Did we cook in the editor instead of from UAT (cook in editor uses a different staging directory)
/// </summary>
[Help("CookInEditor", "Did we cook in the editor instead of in UAT")]
public bool CookInEditor { private set ; get ; }
2017-04-10 11:00:33 -04:00
/// <summary>
/// Cook: Output directory for cooked data
/// </summary>
public string CookOutputDir ;
2016-11-21 20:27:58 -05:00
/// <summary>
/// Cook: Base this cook of a already released version of the cooked data
/// </summary>
public string BasedOnReleaseVersion ;
2014-12-15 11:35:52 -05:00
2015-09-09 09:35:59 -04:00
/// <summary>
/// Cook: Path to the root of the directory where we store released versions of the game for a given version
/// </summary>
public string BasedOnReleaseVersionBasePath ;
/// <summary>
/// Cook: Path to the root of the directory to create a new released version of the game.
/// </summary>
public string CreateReleaseVersionBasePath ;
2015-03-30 11:56:48 -04:00
/// <summary>
/// Are we generating a patch, generate a patch from a previously released version of the game (use CreateReleaseVersion to create a release).
/// this requires BasedOnReleaseVersion
/// see also CreateReleaseVersion, BasedOnReleaseVersion
/// </summary>
public bool GeneratePatch ;
2017-11-09 18:22:55 -05:00
/// <summary>
2017-08-03 14:06:31 -04:00
/// Are we generating a remaster, generate a patch from a previously released version of the game (use CreateReleaseVersion to create a release).
/// this requires BasedOnReleaseVersion
/// see also CreateReleaseVersion, BasedOnReleaseVersion
/// </summary>
public bool GenerateRemaster ;
2015-03-30 11:56:48 -04:00
2017-12-05 21:57:41 -05:00
/// <summary>
/// Required when building remaster package
/// </summary>
public string DiscVersion ;
2017-08-03 14:06:31 -04:00
/// <summary>
2017-06-21 17:09:40 -04:00
/// </summary>
public bool AddPatchLevel ;
/// <summary>
/// Are we staging the unmodified pak files from the base release
public bool StageBaseReleasePaks ;
2017-08-03 14:06:31 -04:00
/// Name of dlc to cook and package (if this paramter is supplied cooks the dlc and packages it into the dlc directory)
2017-11-09 18:22:55 -05:00
/// </summary>
2017-07-21 12:42:36 -04:00
public FileReference DLCFile ;
2014-12-17 10:00:26 -05:00
2015-04-20 11:15:20 -04:00
/// <summary>
/// Enable cooking of engine content when cooking dlc
/// not included in original release but is referenced by current cook
/// </summary>
public bool DLCIncludeEngineContent ;
2017-11-09 18:22:55 -05:00
/// <summary>
/// Enable packaging up the uplugin file inside the dlc pak. This is sometimes desired if you want the plugin to be standalone
/// </summary>
public bool DLCPakPluginFile ;
/// <summary>
/// DLC will remap it's files to the game directory and act like a patch. This is useful if you want to override content in the main game along side your main game.
/// For example having different main game content in different DLCs
/// </summary>
public bool DLCActLikePatch ;
/// <summary>
/// After cook completes diff the cooked content against another cooked content directory.
/// report all errors to the log
/// </summary>
public string DiffCookedContentPath ;
2015-08-11 17:11:41 -04:00
2014-12-15 11:35:52 -05:00
/// <summary>
/// Cook: Additional cooker options to include on the cooker commandline
/// </summary>
public string AdditionalCookerOptions ;
2014-10-27 19:33:51 -04:00
/// <summary>
/// Cook: List of cultures to cook.
/// </summary>
2016-01-08 19:10:43 -05:00
public ParamList < string > CulturesToCook ;
2014-03-14 14:13:41 -04:00
2014-10-27 19:33:51 -04:00
/// <summary>
/// Compress packages during cook.
/// </summary>
public bool Compressed ;
2018-05-23 21:04:31 -04:00
/// <summary>
/// Additional parameters when generating the PAK file
/// </summary>
public string AdditionalPakOptions ;
2020-09-01 14:07:48 -04:00
/// <summary>
/// Additional parameters when generating iostore container files
/// </summary>
public string AdditionalIoStoreOptions ;
2015-02-04 16:18:11 -05:00
/// <summary>
2015-07-06 10:03:34 -04:00
/// Cook: Do not include a version number in the cooked content
2015-02-04 16:18:11 -05:00
/// </summary>
2016-01-20 11:32:08 -05:00
public bool UnversionedCookedContent = true ;
2015-02-04 16:18:11 -05:00
2015-03-30 11:56:48 -04:00
2014-03-14 14:13:41 -04:00
/// <summary>
/// Cook: Uses the iterative cooking, command line: -iterativecooking or -iterate
/// </summary>
[Help( "iterativecooking", "Uses the iterative cooking, command line: -iterativecooking or -iterate" )]
public bool IterativeCooking ;
2016-11-21 20:27:58 -05:00
/// <summary>
2017-05-16 13:13:20 -04:00
/// Cook: Iterate from a build on the network
2016-11-21 20:27:58 -05:00
/// </summary>
[Help("Iteratively cook from a shared cooked build")]
2018-05-23 21:04:31 -04:00
public string IterateSharedCookedBuild ;
2016-11-21 20:27:58 -05:00
2017-05-16 13:13:20 -04:00
/// <summary>
/// Build: Don't build the game instead use the prebuild exe (requires iterate shared cooked build
/// </summary>
[Help("Iteratively cook from a shared cooked build")]
public bool IterateSharedBuildUsePrecompiledExe ;
2016-11-21 20:27:58 -05:00
/// <summary>
/// Cook: Only cook maps (and referenced content) instead of cooking everything only affects -cookall flag
/// </summary>
[Help("CookMapsOnly", "Cook only maps this only affects usage of -cookall the flag")]
2015-02-04 16:18:11 -05:00
public bool CookMapsOnly ;
/// <summary>
/// Cook: Only cook maps (and referenced content) instead of cooking everything only affects cookall flag
/// </summary>
[Help("CookAll", "Cook all the things in the content directory for this project")]
public bool CookAll ;
2015-07-06 10:03:34 -04:00
/// <summary>
/// Cook: Skip cooking editor content
/// </summary>
2015-08-18 07:32:09 -04:00
[Help("SkipCookingEditorContent", "Skips content under /Engine/Editor when cooking")]
2015-07-06 10:03:34 -04:00
public bool SkipCookingEditorContent ;
/// <summary>
/// Cook: number of additional cookers to spawn while cooking
/// </summary>
public int NumCookersToSpawn ;
2014-12-11 16:20:07 -05:00
/// <summary>
/// Cook: Uses the iterative deploy, command line: -iterativedeploy or -iterate
/// </summary>
[Help("iterativecooking", "Uses the iterative cooking, command line: -iterativedeploy or -iterate")]
public bool IterativeDeploy ;
2015-06-09 10:11:45 -04:00
[Help("FastCook", "Uses fast cook path if supported by target")]
public bool FastCook ;
2015-02-04 16:18:11 -05:00
2015-06-09 10:11:45 -04:00
/// <summary>
/// Cook: Ignores cook errors and continues with packaging etc.
/// </summary>
[Help("IgnoreCookErrors", "Ignores cook errors and continues with packaging etc")]
public bool IgnoreCookErrors { private set ; get ; }
2015-02-04 16:18:11 -05:00
2014-03-14 14:13:41 -04:00
/// <summary>
2017-05-03 14:18:32 -04:00
/// Stage: Commandline: -nodebuginfo
2014-03-14 14:13:41 -04:00
/// </summary>
[Help("nodebuginfo", "do not copy debug files to the stage")]
public bool NoDebugInfo { private set ; get ; }
2018-02-22 11:25:06 -05:00
/// <summary>
/// Stage: Commandline: -separatedebuginfo
/// </summary>
[Help("separatedebuginfo", "output debug info to a separate directory")]
public bool SeparateDebugInfo { private set ; get ; }
2017-05-03 14:18:32 -04:00
/// <summary>
/// Stage: Commandline: -mapfile
/// </summary>
[Help("MapFile", "generates a *.map file")]
public bool MapFile { private set ; get ; }
2014-03-14 14:13:41 -04:00
/// <summary>
/// true if the staging directory is to be cleaned: -cleanstage (also true if -clean is specified)
/// </summary>
[Help("nocleanstage", "skip cleaning the stage directory")]
public bool NoCleanStage { set { bNoCleanStage = value ; } get { return SkipStage | | bNoCleanStage ; } }
private bool bNoCleanStage ;
/// <summary>
/// Stage: If non-empty, the contents will be put into the stage
/// </summary>
[Help("cmdline", "command line to put into the stage in UE4CommandLine.txt")]
public string StageCommandline ;
2014-10-27 19:33:51 -04:00
/// <summary>
2014-03-14 14:13:41 -04:00
/// Stage: If non-empty, the contents will be used for the bundle name
/// </summary>
[Help("bundlename", "string to use as the bundle name when deploying to mobile device")]
2014-10-27 19:33:51 -04:00
public string BundleName ;
2014-03-14 14:13:41 -04:00
2020-01-13 06:48:39 -05:00
//<summary>
/// Stage: Specifies a list of extra targets that should be staged along with a client
/// </summary>
public ParamList < string > ExtraTargetsToStageWithClient = new ParamList < string > ( ) ;
2020-09-24 00:43:27 -04:00
/// <summary>
/// Stage: Optional callback that a build script can use to modify a deployment context immediately after it is created
/// </summary>
public Action < ProjectParams , DeploymentContext > PreModifyDeploymentContextCallback = null ;
/// <summary>
/// Stage: Optional callback that a build script can use to modify a deployment context before it is applied
/// </summary>
public Action < ProjectParams , DeploymentContext > ModifyDeploymentContextCallback = null ;
2020-02-24 05:19:44 -05:00
2014-10-27 19:33:51 -04:00
/// <summary>
/// On Windows, adds an executable to the root of the staging directory which checks for prerequisites being
2014-10-15 10:07:06 -04:00
/// installed and launches the game with a path to the .uproject file.
/// </summary>
2014-10-27 19:33:51 -04:00
public bool NoBootstrapExe { get ; set ; }
2014-10-15 10:07:06 -04:00
2015-07-10 14:06:52 -04:00
/// <summary>
/// By default we don't code sign unless it is required or requested
/// </summary>
public bool bCodeSign = false ;
2015-09-18 13:42:25 -04:00
/// <summary>
/// Provision to use
/// </summary>
public string Provision = null ;
2015-10-02 14:24:38 -04:00
/// <summary>
/// Certificate to use
/// </summary>
public string Certificate = null ;
2017-04-11 10:32:07 -04:00
/// <summary>
/// Team ID to use
/// </summary>
public string Team = null ;
/// <summary>
/// true if provisioning is automatically managed
/// </summary>
public bool AutomaticSigning = false ;
2015-12-08 09:25:02 -05:00
/// <summary>
/// TitleID to package
/// </summary>
public ParamList < string > TitleID = new ParamList < string > ( ) ;
2016-03-14 21:21:09 -04:00
/// <summary>
/// If true, non-shipping binaries will be considered DebugUFS files and will appear on the debugfiles manifest
/// </summary>
public bool bTreatNonShippingBinariesAsDebugFiles = false ;
2018-02-22 11:25:06 -05:00
/// <summary>
/// If true, use chunk manifest files generated for extra flavor
/// </summary>
public bool bUseExtraFlavor = false ;
2014-03-14 14:13:41 -04:00
/// <summary>
/// Run: True if the Run step should be executed, command: -run
/// </summary>
[Help("run", "run the game after it is built (including server, if -server)")]
public bool Run { private set ; get ; }
/// <summary>
/// Run: The client runs with cooked data provided by cook on the fly server, command line: -cookonthefly
/// </summary>
[Help("cookonthefly", "run the client with cooked data provided by cook on the fly server")]
public bool CookOnTheFly { private set ; get ; }
2015-01-15 16:07:06 -05:00
/// <summary>
/// Run: The client should run in streaming mode when connecting to cook on the fly server
/// </summary>
[Help("Cookontheflystreaming", "run the client in streaming cook on the fly mode (don't cache files locally instead force reget from server each file load)")]
public bool CookOnTheFlyStreaming { private set ; get ; }
2016-09-09 20:13:41 -04:00
2014-03-14 14:13:41 -04:00
/// <summary>
/// Run: The client runs with cooked data provided by UnrealFileServer, command line: -fileserver
/// </summary>
[Help("fileserver", "run the client with cooked data provided by UnrealFileServer")]
public bool FileServer { private set ; get ; }
/// <summary>
/// Run: The client connects to dedicated server to get data, command line: -dedicatedserver
/// </summary>
[Help("dedicatedserver", "build, cook and run both a client and a server (also -server)")]
public bool DedicatedServer { private set ; get ; }
/// <summary>
/// Run: Uses a client target configuration, also implies -dedicatedserver, command line: -client
/// </summary>
[Help( "client", "build, cook and run a client and a server, uses client target configuration" )]
public bool Client { private set ; get ; }
/// <summary>
/// Run: Whether the client should start or not, command line (to disable): -noclient
/// </summary>
[Help("noclient", "do not run the client, just run the server")]
public bool NoClient { private set ; get ; }
/// <summary>
/// Run: Client should create its own log window, command line: -logwindow
/// </summary>
[Help("logwindow", "create a log window for the client")]
public bool LogWindow { private set ; get ; }
/// <summary>
/// Run: Map to run the game with.
/// </summary>
[Help("map", "map to run the game with")]
public string MapToRun ;
2014-04-23 16:44:23 -04:00
/// <summary>
/// Run: Additional server map params.
/// </summary>
[Help("AdditionalServerMapParams", "Additional server map params, i.e ?param=value")]
public string AdditionalServerMapParams ;
2014-03-14 14:13:41 -04:00
/// <summary>
2014-12-18 17:37:28 -05:00
/// Run: The target device to run the game on. Comes in the form platform@devicename.
2014-03-14 14:13:41 -04:00
/// </summary>
2016-07-19 19:13:01 -04:00
[Help("device", "Devices to run the game on")]
public ParamList < string > Devices ;
2014-03-14 14:13:41 -04:00
2014-12-18 17:37:28 -05:00
/// <summary>
/// Run: The target device to run the game on. No platform prefix.
/// </summary>
2016-07-19 19:13:01 -04:00
[Help("device", "Device names without the platform prefix to run the game on")]
public ParamList < string > DeviceNames ;
2014-12-18 17:37:28 -05:00
2014-03-14 14:13:41 -04:00
/// <summary>
/// Run: the target device to run the server on
/// </summary>
[Help("serverdevice", "Device to run the server on")]
public string ServerDevice ;
/// <summary>
/// Run: The indicated server has already been started
/// </summary>
[Help("skipserver", "Skip starting the server")]
public bool SkipServer ;
/// <summary>
/// Run: The indicated server has already been started
/// </summary>
[Help("numclients=n", "Start extra clients, n should be 2 or more")]
public int NumClients ;
/// <summary>
/// Run: Additional command line arguments to pass to the program
/// </summary>
[Help("addcmdline", "Additional command line arguments for the program")]
public string RunCommandline ;
2016-09-01 21:20:38 -04:00
/// <summary>
/// Run: Additional command line arguments to pass to the server
/// </summary>
[Help("servercmdline", "Additional command line arguments for the program")]
public string ServerCommandline ;
2017-05-09 17:15:32 -04:00
/// <summary>
/// Run: Override command line arguments to pass to the client, if set it will not try to guess at IPs or settings
/// </summary>
[Help("clientcmdline", "Override command line arguments to pass to the client")]
public string ClientCommandline ;
2014-10-27 19:33:51 -04:00
/// <summary>
/// Run:adds -nullrhi to the client commandline
/// </summary>
[Help("nullrhi", "add -nullrhi to the client commandlines")]
public bool NullRHI ;
2014-03-14 14:13:41 -04:00
2014-10-27 19:33:51 -04:00
/// <summary>
/// Run:adds ?fake to the server URL
/// </summary>
[Help("fakeclient", "adds ?fake to the server URL")]
public bool FakeClient ;
2014-03-14 14:13:41 -04:00
2014-10-27 19:33:51 -04:00
/// <summary>
/// Run:adds ?fake to the server URL
/// </summary>
[Help("editortest", "rather than running a client, run the editor instead")]
public bool EditorTest ;
2014-03-14 14:13:41 -04:00
2014-10-27 19:33:51 -04:00
/// <summary>
/// Run:when running -editortest or a client, run all automation tests, not compatible with -server
/// </summary>
[Help("RunAutomationTests", "when running -editortest or a client, run all automation tests, not compatible with -server")]
public bool RunAutomationTests ;
2014-03-14 14:13:41 -04:00
2014-10-27 19:33:51 -04:00
/// <summary>
/// Run:when running -editortest or a client, run all automation tests, not compatible with -server
/// </summary>
[Help("RunAutomationTests", "when running -editortest or a client, run a specific automation tests, not compatible with -server")]
public string RunAutomationTest ;
2014-03-14 14:13:41 -04:00
2014-10-27 19:33:51 -04:00
/// <summary>
/// Run: Adds commands like debug crash, debug rendercrash, etc based on index
/// </summary>
[Help("Crash=index", "when running -editortest or a client, adds commands like debug crash, debug rendercrash, etc based on index")]
public int CrashIndex ;
2014-03-14 14:13:41 -04:00
2014-10-27 19:33:51 -04:00
public ParamList < string > Port ;
2014-03-14 14:13:41 -04:00
2014-10-27 19:33:51 -04:00
/// <summary>
/// Run: Linux username for unattended key genereation
/// </summary>
[Help("deviceuser", "Linux username for unattended key genereation")]
public string DeviceUsername ;
2014-03-14 14:13:41 -04:00
2014-10-27 19:33:51 -04:00
/// <summary>
/// Run: Linux password for unattended key genereation
/// </summary>
2016-11-21 20:27:58 -05:00
[Help("devicepass", "Linux password")]
2014-10-27 19:33:51 -04:00
public string DevicePassword ;
2014-03-14 14:13:41 -04:00
2014-10-27 19:33:51 -04:00
/// <summary>
2016-11-21 20:27:58 -05:00
/// Run: Server device IP address
2014-10-27 19:33:51 -04:00
/// </summary>
public string ServerDeviceAddress ;
2014-03-14 14:13:41 -04:00
[Help("package", "package the project for the target platform")]
public bool Package { get ; set ; }
2020-04-10 11:30:32 -04:00
[Help("skippackage", "Skips packaging the project for the target platform")]
public bool SkipPackage { get ; set ; }
2018-02-22 11:25:06 -05:00
[Help("package", "Determine whether data is packaged. This can be an iteration optimization for platforms that require packages for deployment")]
public bool ForcePackageData { get ; set ; }
2014-03-14 14:13:41 -04:00
[Help("distribution", "package for distribution the project")]
public bool Distribution { get ; set ; }
2014-09-23 13:55:06 -04:00
[Help("prereqs", "stage prerequisites along with the project")]
public bool Prereqs { get ; set ; }
2016-07-12 15:06:08 -04:00
[Help("applocaldir", "location of prerequisites for applocal deployment")]
public string AppLocalDirectory { get ; set ; }
[Help("Prebuilt", "this is a prebuilt cooked and packaged build")]
2014-10-27 19:33:51 -04:00
public bool Prebuilt { get ; private set ; }
2014-06-04 15:01:25 -04:00
2014-10-27 19:33:51 -04:00
[Help("RunTimeoutSeconds", "timeout to wait after we lunch the game")]
public int RunTimeoutSeconds ;
2014-06-04 15:01:25 -04:00
2015-05-13 12:27:09 -04:00
[Help("SpecifiedArchitecture", "Determine a specific Minimum OS")]
public string SpecifiedArchitecture ;
2014-06-04 15:01:25 -04:00
2018-02-22 11:25:06 -05:00
[Help("UbtArgs", "extra options to pass to ubt")]
public string UbtArgs ;
2014-03-14 14:13:41 -04:00
2018-11-14 19:05:13 -05:00
[Help("AdditionalPackageOptions", "extra options to pass to the platform's packager")]
public string AdditionalPackageOptions { get ; set ; }
2014-03-14 14:13:41 -04:00
2019-09-13 14:02:02 -04:00
[Help("deploy", "deploy the project for the target platform")]
2014-03-14 14:13:41 -04:00
public bool Deploy { get ; set ; }
2016-11-20 21:35:35 -05:00
[Help("deploy", "Location to deploy to on the target platform")]
public string DeployFolder { get ; set ; }
2018-04-03 15:23:51 -04:00
[Help("getfile", "download file from target after successful run")]
public string GetFile { get ; set ; }
2015-09-29 10:04:26 -04:00
[Help("MapsToRebuildLightMaps", "List of maps that need light maps rebuilding")]
public ParamList < string > MapsToRebuildLightMaps = new ParamList < string > ( ) ;
2018-02-22 11:25:06 -05:00
[Help("MapsToRebuildHLODMaps", "List of maps that need HLOD rebuilding")]
public ParamList < string > MapsToRebuildHLODMaps = new ParamList < string > ( ) ;
[Help("IgnoreLightMapErrors", "Whether Light Map errors should be treated as critical")]
2015-09-29 10:04:26 -04:00
public bool IgnoreLightMapErrors { get ; set ; }
2018-08-20 13:55:11 -04:00
private List < SingleTargetProperties > DetectedTargets ;
2016-12-13 11:58:16 -05:00
private Dictionary < UnrealTargetPlatform , ConfigHierarchy > LoadedEngineConfigs ;
private Dictionary < UnrealTargetPlatform , ConfigHierarchy > LoadedGameConfigs ;
2014-05-29 17:38:00 -04:00
2018-08-20 13:55:11 -04:00
private List < String > TargetNamesOfType ( TargetType DesiredType )
{
return DetectedTargets . FindAll ( Target = > Target . Rules . Type = = DesiredType ) . ConvertAll ( Target = > Target . TargetName ) ;
}
2019-09-13 13:29:44 -04:00
private String ChooseTarget ( List < String > Targets , TargetType Type )
2018-08-20 13:55:11 -04:00
{
2019-09-13 13:29:44 -04:00
switch ( Targets . Count )
2018-08-20 13:55:11 -04:00
{
2019-09-13 13:29:44 -04:00
case 1 :
return Targets . First ( ) ;
case 0 :
throw new AutomationException ( "{0} target not found!" , Type ) ;
default :
throw new AutomationException ( "More than one {0} target found. Specify which one to use with the -{1}= option." , Type , Type ) ;
2018-08-20 13:55:11 -04:00
}
}
2014-03-14 14:13:41 -04:00
private void AutodetectSettings ( bool bReset )
{
if ( bReset )
{
EditorTargetsList = null ;
ClientCookedTargetsList = null ;
ServerCookedTargetsList = null ;
ProgramTargetsList = null ;
2017-12-12 18:32:45 -05:00
ProjectPlatformBinariesPaths = null ;
ProjectExePaths = null ;
2014-03-14 14:13:41 -04:00
}
2018-08-20 13:55:11 -04:00
List < UnrealTargetPlatform > ClientTargetPlatformTypes = ClientTargetPlatforms . ConvertAll ( x = > x . Type ) . Distinct ( ) . ToList ( ) ;
var Properties = ProjectUtils . GetProjectProperties ( RawProjectPath , ClientTargetPlatformTypes , ClientConfigsToBuild , RunAssetNativization ) ;
2014-03-14 14:13:41 -04:00
2018-08-20 13:55:11 -04:00
bIsCodeBasedProject = Properties . bIsCodeBasedProject ;
2014-03-14 14:13:41 -04:00
DetectedTargets = Properties . Targets ;
2014-05-29 17:38:00 -04:00
LoadedEngineConfigs = Properties . EngineConfigs ;
LoadedGameConfigs = Properties . GameConfigs ;
2014-03-14 14:13:41 -04:00
var GameTarget = String . Empty ;
var EditorTarget = String . Empty ;
var ServerTarget = String . Empty ;
var ProgramTarget = String . Empty ;
2018-08-20 13:55:11 -04:00
2017-01-30 16:52:08 -05:00
var ProjectType = TargetType . Game ;
2014-03-14 14:13:41 -04:00
2016-03-08 09:00:48 -05:00
if ( ! bIsCodeBasedProject )
2014-03-14 14:13:41 -04:00
{
2020-09-11 15:54:42 -04:00
GameTarget = Client ? "UnrealClient" : "UnrealGame" ;
2020-09-10 15:39:00 -04:00
EditorTarget = "UnrealEditor" ;
2020-09-11 15:54:42 -04:00
ServerTarget = "UnrealServer" ;
2014-03-14 14:13:41 -04:00
}
2019-09-13 13:29:44 -04:00
else if ( TargetNames . Count > 0 )
2014-03-14 14:13:41 -04:00
{
2019-09-13 13:29:44 -04:00
// Resolve all the targets that need to be built
List < SingleTargetProperties > Targets = new List < SingleTargetProperties > ( ) ;
foreach ( string TargetName in TargetNames )
{
SingleTargetProperties Target = DetectedTargets . FirstOrDefault ( x = > String . Equals ( x . TargetName , TargetName , StringComparison . OrdinalIgnoreCase ) ) ;
if ( Target = = null )
{
throw new AutomationException ( "Unable to find target '{0}'" , TargetName ) ;
}
Targets . Add ( Target ) ;
}
// Make sure we haven't specified game and clients together
if ( Targets . Any ( x = > x . Rules . Type = = TargetType . Client ) & & Targets . Any ( x = > x . Rules . Type = = TargetType . Game ) )
{
throw new AutomationException ( "Cannot specify client ang game targets to be built together" ) ;
}
// Create the lists to receive all the target types
if ( ClientCookedTargetsList = = null )
{
ClientCookedTargetsList = new ParamList < string > ( ) ;
}
if ( ServerCookedTargetsList = = null )
{
ServerCookedTargetsList = new ParamList < string > ( ) ;
}
if ( ProgramTargetsList = = null )
{
ProgramTargetsList = new ParamList < string > ( ) ;
}
// Add them to the appropriate lists
bool bHasGameTarget = false ;
foreach ( SingleTargetProperties Target in Targets )
{
if ( Target . Rules . Type = = TargetType . Game )
{
ClientCookedTargetsList . Add ( Target . TargetName ) ;
bHasGameTarget = true ;
}
else if ( Target . Rules . Type = = TargetType . Client )
{
ClientCookedTargetsList . Add ( Target . TargetName ) ;
Client = true ;
}
else if ( Target . Rules . Type = = TargetType . Server )
{
ServerCookedTargetsList . Add ( Target . TargetName ) ;
DedicatedServer = true ;
}
else
{
ProgramTargetsList . Add ( Target . TargetName ) ;
ProjectType = TargetType . Program ;
}
}
2019-09-16 16:17:08 -04:00
// If we don't have any game/client targets, don't stage any client executable
if ( ClientCookedTargetsList . Count = = 0 )
{
NoClient = true ;
}
2019-09-16 16:39:07 -04:00
else
{
GameTarget = ClientCookedTargetsList [ 0 ] ;
}
2019-09-16 16:17:08 -04:00
2019-09-13 13:29:44 -04:00
// Validate all the settings
if ( Client & & bHasGameTarget )
{
throw new AutomationException ( "Cannot mix game and client targets" ) ;
}
// Find the editor target name
List < SingleTargetProperties > EditorTargets = Properties . Targets . Where ( x = > x . Rules . Type = = TargetType . Editor ) . ToList ( ) ;
if ( EditorTargets . Count = = 1 )
{
EditorTarget = EditorTargets [ 0 ] . TargetName ;
}
else if ( EditorTargets . Count > 1 )
{
throw new AutomationException ( "There can be only one Editor target per project." ) ;
}
2014-03-14 14:13:41 -04:00
}
else if ( ! CommandUtils . IsNullOrEmpty ( Properties . Targets ) )
{
2018-08-20 13:55:11 -04:00
List < String > AvailableGameTargets = TargetNamesOfType ( TargetType . Game ) ;
List < String > AvailableClientTargets = TargetNamesOfType ( TargetType . Client ) ;
List < String > AvailableServerTargets = TargetNamesOfType ( TargetType . Server ) ;
2020-01-24 03:22:33 -05:00
List < String > AvailableEditorTargets = TargetNamesOfType ( TargetType . Editor ) ;
2014-03-14 14:13:41 -04:00
2018-08-20 13:55:11 -04:00
// That should cover all detected targets; Program targets are handled separately.
System . Diagnostics . Debug . Assert ( DetectedTargets . Count = = ( AvailableGameTargets . Count + AvailableClientTargets . Count + AvailableServerTargets . Count + AvailableEditorTargets . Count ) ) ;
if ( Client )
2014-03-14 14:13:41 -04:00
{
2019-09-13 13:29:44 -04:00
GameTarget = ChooseTarget ( AvailableClientTargets , TargetType . Client ) ;
2018-08-20 13:55:11 -04:00
ProjectType = TargetType . Client ;
}
else if ( AvailableGameTargets . Count > 0 )
{
2020-01-13 06:48:39 -05:00
if ( AvailableGameTargets . Count > 1 )
2014-03-14 14:13:41 -04:00
{
2018-08-20 13:55:11 -04:00
throw new AutomationException ( "There can be only one Game target per project." ) ;
2014-03-14 14:13:41 -04:00
}
2018-08-20 13:55:11 -04:00
GameTarget = AvailableGameTargets . First ( ) ;
}
if ( AvailableEditorTargets . Count > 0 )
{
2020-01-24 03:22:33 -05:00
string DefaultEditorTarget ;
2018-08-20 13:55:11 -04:00
2020-01-24 03:22:33 -05:00
if ( EngineConfigs [ BuildHostPlatform . Current . Platform ] . GetString ( "/Script/BuildSettings.BuildSettings" , "DefaultEditorTarget" , out DefaultEditorTarget ) )
{
if ( ! AvailableEditorTargets . Contains ( DefaultEditorTarget ) )
{
throw new AutomationException ( string . Format ( "A default editor target '{0}' was specified in engine.ini but does not exist" , DefaultEditorTarget ) ) ;
}
EditorTarget = DefaultEditorTarget ;
}
else
{
if ( AvailableEditorTargets . Count > 1 )
{
2020-08-11 01:36:57 -04:00
throw new AutomationException ( "Project contains multiple editor targets but no DefaultEditorTarget is set in the [/Script/BuildSettings.BuildSettings] section of DefaultEngine.ini" ) ;
2020-01-24 03:22:33 -05:00
}
EditorTarget = AvailableEditorTargets . First ( ) ;
}
2014-03-14 14:13:41 -04:00
}
2018-08-20 13:55:11 -04:00
if ( AvailableServerTargets . Count > 0 & & ( DedicatedServer | | Cook | | CookOnTheFly ) ) // only if server is needed
2014-03-14 14:13:41 -04:00
{
2019-09-13 13:29:44 -04:00
ServerTarget = ChooseTarget ( AvailableServerTargets , TargetType . Server ) ;
2014-03-14 14:13:41 -04:00
}
}
2014-06-27 11:48:20 -04:00
else if ( ! CommandUtils . IsNullOrEmpty ( Properties . Programs ) )
{
SingleTargetProperties TargetData = Properties . Programs [ 0 ] ;
2017-01-30 16:52:08 -05:00
ProjectType = TargetType . Program ;
2014-06-27 11:48:20 -04:00
ProgramTarget = TargetData . TargetName ;
GameTarget = TargetData . TargetName ;
}
2014-05-02 09:54:01 -04:00
else if ( ! this . Build )
{
var ShortName = ProjectUtils . GetShortProjectName ( RawProjectPath ) ;
2018-08-20 13:55:11 -04:00
GameTarget = Client ? ( ShortName + "Client" ) : ShortName ;
2014-05-02 09:54:01 -04:00
EditorTarget = ShortName + "Editor" ;
ServerTarget = ShortName + "Server" ;
}
2014-03-14 14:13:41 -04:00
else
{
throw new AutomationException ( "{0} does not look like uproject file but no targets have been found!" , RawProjectPath ) ;
}
2017-01-30 16:52:08 -05:00
IsProgramTarget = ProjectType = = TargetType . Program ;
2014-03-14 14:13:41 -04:00
2018-08-20 13:55:11 -04:00
if ( String . IsNullOrEmpty ( EditorTarget ) & & ! IsProgramTarget & & CommandUtils . IsNullOrEmpty ( EditorTargetsList ) )
2014-03-14 14:13:41 -04:00
{
2015-02-27 16:10:22 -05:00
if ( Properties . bWasGenerated )
{
2020-09-10 15:39:00 -04:00
EditorTarget = "UnrealEditor" ;
2015-02-27 16:10:22 -05:00
}
else
{
throw new AutomationException ( "Editor target not found!" ) ;
}
2014-03-14 14:13:41 -04:00
}
2018-08-20 13:55:11 -04:00
2014-03-14 14:13:41 -04:00
if ( EditorTargetsList = = null )
{
2018-08-20 13:55:11 -04:00
if ( ! GlobalCommandLine . NoCompileEditor & & ! IsProgramTarget & & ! String . IsNullOrEmpty ( EditorTarget ) )
2014-03-14 14:13:41 -04:00
{
EditorTargetsList = new ParamList < string > ( EditorTarget ) ;
}
else
{
EditorTargetsList = new ParamList < string > ( ) ;
}
}
if ( ProgramTargetsList = = null )
{
2018-08-20 13:55:11 -04:00
if ( IsProgramTarget )
2014-03-14 14:13:41 -04:00
{
ProgramTargetsList = new ParamList < string > ( ProgramTarget ) ;
}
else
{
ProgramTargetsList = new ParamList < string > ( ) ;
}
}
2018-02-22 11:25:06 -05:00
// Compile a client if it was asked for (-client) or we're cooking and require a client
2018-08-20 13:55:11 -04:00
if ( ClientCookedTargetsList = = null )
2014-03-14 14:13:41 -04:00
{
2018-08-20 13:55:11 -04:00
if ( ! NoClient & & ( Cook | | CookOnTheFly | | Prebuilt | | Client ) )
2014-03-14 14:13:41 -04:00
{
2018-08-20 13:55:11 -04:00
if ( String . IsNullOrEmpty ( GameTarget ) )
{
throw new AutomationException ( "Game target not found. Game target is required with -cook or -cookonthefly" ) ;
}
ClientCookedTargetsList = new ParamList < string > ( GameTarget ) ;
2020-01-13 06:48:39 -05:00
if ( ExtraTargetsToStageWithClient ! = null )
{
ClientCookedTargetsList . AddRange ( ExtraTargetsToStageWithClient ) ;
}
2018-08-20 13:55:11 -04:00
}
2014-03-14 14:13:41 -04:00
else
{
2018-08-20 13:55:11 -04:00
ClientCookedTargetsList = new ParamList < string > ( ) ;
2014-03-14 14:13:41 -04:00
}
}
2018-08-20 13:55:11 -04:00
// Compile a server if it was asked for (-server) or we're cooking and require a server
if ( ServerCookedTargetsList = = null )
2014-03-14 14:13:41 -04:00
{
2018-08-21 13:06:12 -04:00
/* Simplified from previous version which makes less sense.
TODO: tease out the actual dependencies between -cook and -server options, fix properly
if (DedicatedServer && (Cook || CookOnTheFly || DedicatedServer)) */
if ( DedicatedServer )
2018-08-20 13:55:11 -04:00
{
if ( String . IsNullOrEmpty ( ServerTarget ) )
{
throw new AutomationException ( "Server target not found. Server target is required with -server and -cook or -cookonthefly" ) ;
}
ServerCookedTargetsList = new ParamList < string > ( ServerTarget ) ;
}
else
{
ServerCookedTargetsList = new ParamList < string > ( ) ;
}
2014-03-14 14:13:41 -04:00
}
2017-12-12 18:32:45 -05:00
if ( ProjectPlatformBinariesPaths = = null | | ProjectExePaths = = null )
2014-03-14 14:13:41 -04:00
{
2017-12-12 18:32:45 -05:00
ProjectPlatformBinariesPaths = new Dictionary < UnrealTargetPlatform , DirectoryReference > ( ) ;
ProjectExePaths = new Dictionary < UnrealTargetPlatform , FileReference > ( ) ;
var ProjectClientBinariesPath = ProjectUtils . GetClientProjectBinariesRootPath ( RawProjectPath , ProjectType , Properties . bIsCodeBasedProject ) ;
foreach ( TargetPlatformDescriptor TargetPlatform in ClientTargetPlatforms )
2014-03-14 14:13:41 -04:00
{
2017-12-12 18:32:45 -05:00
DirectoryReference BinariesPath = ProjectUtils . GetProjectClientBinariesFolder ( ProjectClientBinariesPath , TargetPlatform . Type ) ;
ProjectPlatformBinariesPaths [ TargetPlatform . Type ] = BinariesPath ;
ProjectExePaths [ TargetPlatform . Type ] = FileReference . Combine ( BinariesPath , GameTarget + Platform . GetExeExtension ( TargetPlatform . Type ) ) ;
2014-03-14 14:13:41 -04:00
}
}
}
public bool HasEditorTargets
{
get { return ! CommandUtils . IsNullOrEmpty ( EditorTargets ) ; }
}
public bool HasCookedTargets
{
get { return ! CommandUtils . IsNullOrEmpty ( ClientCookedTargets ) | | ! CommandUtils . IsNullOrEmpty ( ServerCookedTargets ) ; }
}
public bool HasServerCookedTargets
{
get { return ! CommandUtils . IsNullOrEmpty ( ServerCookedTargets ) ; }
}
public bool HasClientCookedTargets
{
get { return ! CommandUtils . IsNullOrEmpty ( ClientCookedTargets ) ; }
}
public bool HasProgramTargets
{
get { return ! CommandUtils . IsNullOrEmpty ( ProgramTargets ) ; }
}
public bool HasMapsToCook
{
get { return ! CommandUtils . IsNullOrEmpty ( MapsToCook ) ; }
}
2017-01-27 23:32:44 -05:00
public bool HasMapIniSectionsToCook
{
get { return ! CommandUtils . IsNullOrEmpty ( MapIniSectionsToCook ) ; }
}
2014-03-14 14:13:41 -04:00
public bool HasDirectoriesToCook
{
get { return ! CommandUtils . IsNullOrEmpty ( DirectoriesToCook ) ; }
}
2018-05-23 21:04:31 -04:00
public bool HasIterateSharedCookedBuild
{
get { return ! String . IsNullOrEmpty ( IterateSharedCookedBuild ) ; }
}
2020-09-24 00:43:27 -04:00
public bool HasDDCGraph
{
get { return ! String . IsNullOrEmpty ( DDCGraph ) ; }
}
2014-10-27 19:33:51 -04:00
public bool HasInternationalizationPreset
{
get { return ! String . IsNullOrEmpty ( InternationalizationPreset ) ; }
}
2014-12-15 11:35:52 -05:00
public bool HasBasedOnReleaseVersion
{
get { return ! String . IsNullOrEmpty ( BasedOnReleaseVersion ) ; }
}
public bool HasAdditionalCookerOptions
{
get { return ! String . IsNullOrEmpty ( AdditionalCookerOptions ) ; }
}
2014-12-17 10:00:26 -05:00
public bool HasDLCName
{
2017-07-21 12:42:36 -04:00
get { return DLCFile ! = null ; }
2014-12-17 10:00:26 -05:00
}
2015-08-11 17:11:41 -04:00
public bool HasDiffCookedContentPath
{
get { return ! String . IsNullOrEmpty ( DiffCookedContentPath ) ; }
}
2014-12-15 11:35:52 -05:00
public bool HasCreateReleaseVersion
{
get { return ! String . IsNullOrEmpty ( CreateReleaseVersion ) ; }
}
2014-10-27 19:33:51 -04:00
public bool HasCulturesToCook
{
2016-01-08 19:10:43 -05:00
get { return CulturesToCook ! = null ; }
2014-10-27 19:33:51 -04:00
}
2014-08-14 16:53:33 -04:00
2014-03-14 14:13:41 -04:00
public bool HasGameTargetDetected
{
2018-08-20 13:55:11 -04:00
get { return ProjectTargets . Exists ( Target = > Target . Rules . Type = = TargetType . Game ) ; }
2014-03-14 14:13:41 -04:00
}
public bool HasClientTargetDetected
{
2018-08-20 13:55:11 -04:00
get { return ProjectTargets . Exists ( Target = > Target . Rules . Type = = TargetType . Client ) ; }
2014-03-14 14:13:41 -04:00
}
public bool HasDedicatedServerAndClient
{
get { return Client & & DedicatedServer ; }
}
/// <summary>
/// Project name (name of the uproject file without extension or directory name where the project is localed)
/// </summary>
public string ShortProjectName
{
get { return ProjectUtils . GetShortProjectName ( RawProjectPath ) ; }
}
2015-02-24 08:51:34 -05:00
/// <summary>
2014-03-14 14:13:41 -04:00
/// True if this project contains source code.
/// </summary>
public bool IsCodeBasedProject
{
get
{
return bIsCodeBasedProject ;
}
}
private bool bIsCodeBasedProject ;
2015-09-26 14:41:15 -04:00
public FileReference CodeBasedUprojectPath
2014-03-14 14:13:41 -04:00
{
2014-10-27 19:33:51 -04:00
get { return IsCodeBasedProject ? RawProjectPath : null ; }
2014-03-14 14:13:41 -04:00
}
/// <summary>
/// True if this project is a program.
/// </summary>
public bool IsProgramTarget { get ; private set ; }
/// <summary>
2017-12-12 18:32:45 -05:00
/// Path where the project's game (or program) binaries are built for the given target platform.
2014-03-14 14:13:41 -04:00
/// </summary>
2017-12-12 18:32:45 -05:00
public DirectoryReference GetProjectBinariesPathForPlatform ( UnrealTargetPlatform InPlatform )
2014-03-14 14:13:41 -04:00
{
2017-12-12 18:32:45 -05:00
DirectoryReference Result = null ;
ProjectPlatformBinariesPaths . TryGetValue ( InPlatform , out Result ) ;
return Result ;
2014-03-14 14:13:41 -04:00
}
2017-12-12 18:32:45 -05:00
private Dictionary < UnrealTargetPlatform , DirectoryReference > ProjectPlatformBinariesPaths ;
/// <summary>
/// Filename of the target game exe (or program exe) for the given target platform
/// </summary>
public FileReference GetProjectExeForPlatform ( UnrealTargetPlatform InPlatform )
{
FileReference Result = null ;
ProjectExePaths . TryGetValue ( InPlatform , out Result ) ;
return Result ;
}
private Dictionary < UnrealTargetPlatform , FileReference > ProjectExePaths ;
2015-09-09 09:35:59 -04:00
2020-09-01 14:07:48 -04:00
/// <summary>
/// Override for the computed based on release version path
/// </summary>
public string BasedOnReleaseVersionPathOverride = null ;
2015-09-09 09:35:59 -04:00
/// <summary>
/// Get the path to the directory of the version we are basing a diff or a patch on.
/// </summary>
2016-07-29 17:10:25 -04:00
public String GetBasedOnReleaseVersionPath ( DeploymentContext SC , bool bIsClientOnly )
2015-09-09 09:35:59 -04:00
{
2020-09-01 14:07:48 -04:00
if ( ! string . IsNullOrEmpty ( BasedOnReleaseVersionPathOverride ) )
{
return BasedOnReleaseVersionPathOverride ;
}
2015-09-09 09:35:59 -04:00
String BasePath = BasedOnReleaseVersionBasePath ;
2016-07-29 17:10:25 -04:00
String Platform = SC . StageTargetPlatform . GetCookPlatform ( SC . DedicatedServer , bIsClientOnly ) ;
2015-09-09 09:35:59 -04:00
if ( String . IsNullOrEmpty ( BasePath ) )
{
2017-06-15 12:43:54 -04:00
BasePath = CommandUtils . CombinePaths ( SC . ProjectRoot . FullName , "Releases" , BasedOnReleaseVersion , Platform ) ;
2015-09-09 09:35:59 -04:00
}
else
{
BasePath = CommandUtils . CombinePaths ( BasePath , BasedOnReleaseVersion , Platform ) ;
}
2016-02-11 14:39:50 -05:00
/*if ( TitleID != null && TitleID.Count == 1 )
{
BasePath = CommandUtils.CombinePaths( BasePath, TitleID[0]);
}*/
2015-09-09 09:35:59 -04:00
return BasePath ;
}
/// <summary>
/// Get the path to the target directory for creating a new release version
/// </summary>
/// <param name="SC"></param>
/// <returns></returns>
2016-07-29 17:10:25 -04:00
public String GetCreateReleaseVersionPath ( DeploymentContext SC , bool bIsClientOnly )
2015-09-09 09:35:59 -04:00
{
String BasePath = CreateReleaseVersionBasePath ;
2016-07-29 17:10:25 -04:00
String Platform = SC . StageTargetPlatform . GetCookPlatform ( SC . DedicatedServer , bIsClientOnly ) ;
2015-09-09 09:35:59 -04:00
if ( String . IsNullOrEmpty ( BasePath ) )
{
2017-06-15 12:43:54 -04:00
BasePath = CommandUtils . CombinePaths ( SC . ProjectRoot . FullName , "Releases" , CreateReleaseVersion , Platform ) ;
2015-09-09 09:35:59 -04:00
}
else
{
BasePath = CommandUtils . CombinePaths ( BasePath , CreateReleaseVersion , Platform ) ;
}
2016-02-11 14:39:50 -05:00
/*if (TitleID != null && TitleID.Count == 1)
{
BasePath = CommandUtils.CombinePaths(BasePath, TitleID[0]);
}*/
2015-09-09 09:35:59 -04:00
return BasePath ;
}
2015-03-30 11:56:48 -04:00
/// <summary>
/// True if we are generating a patch
/// </summary>
public bool IsGeneratingPatch
{
get { return GeneratePatch ; }
}
2017-11-09 18:22:55 -05:00
/// <summary>
2017-06-21 17:09:40 -04:00
/// True if we are generating a new patch pak tier
/// </summary>
public bool ShouldAddPatchLevel
{
get { return AddPatchLevel ; }
}
/// <summary>
/// True if we should stage pak files from the base release
/// </summary>
public bool ShouldStageBaseReleasePaks
{
get { return StageBaseReleasePaks ; }
}
2017-08-03 14:06:31 -04:00
/// <summary>
/// True if we are generating a patch
/// </summary>
public bool IsGeneratingRemaster
{
get { return GenerateRemaster ; }
}
2014-03-14 14:13:41 -04:00
public List < Platform > ClientTargetPlatformInstances
{
get
{
List < Platform > ClientPlatformInstances = new List < Platform > ( ) ;
foreach ( var ClientPlatform in ClientTargetPlatforms )
{
ClientPlatformInstances . Add ( Platform . Platforms [ ClientPlatform ] ) ;
}
return ClientPlatformInstances ;
}
}
2016-07-19 19:13:01 -04:00
public TargetPlatformDescriptor GetCookedDataPlatformForClientTarget ( TargetPlatformDescriptor TargetPlatformDesc )
2014-10-27 19:33:51 -04:00
{
2016-07-19 19:13:01 -04:00
if ( ClientDependentPlatformMap . ContainsKey ( TargetPlatformDesc ) )
2014-10-27 19:33:51 -04:00
{
2016-07-19 19:13:01 -04:00
return ClientDependentPlatformMap [ TargetPlatformDesc ] ;
2014-10-27 19:33:51 -04:00
}
2016-07-19 19:13:01 -04:00
return TargetPlatformDesc ;
2014-10-27 19:33:51 -04:00
}
2014-08-18 13:29:39 -04:00
2014-03-14 14:13:41 -04:00
public List < Platform > ServerTargetPlatformInstances
{
get
{
List < Platform > ServerPlatformInstances = new List < Platform > ( ) ;
foreach ( var ServerPlatform in ServerTargetPlatforms )
{
ServerPlatformInstances . Add ( Platform . Platforms [ ServerPlatform ] ) ;
}
return ServerPlatformInstances ;
}
}
2016-07-19 19:13:01 -04:00
public TargetPlatformDescriptor GetCookedDataPlatformForServerTarget ( TargetPlatformDescriptor TargetPlatformType )
2014-10-27 19:33:51 -04:00
{
if ( ServerDependentPlatformMap . ContainsKey ( TargetPlatformType ) )
{
return ServerDependentPlatformMap [ TargetPlatformType ] ;
}
return TargetPlatformType ;
}
2014-08-18 13:29:39 -04:00
2014-03-14 14:13:41 -04:00
/// <summary>
/// All auto-detected targets for this project
/// </summary>
2018-08-20 13:55:11 -04:00
public List < SingleTargetProperties > ProjectTargets
2014-03-14 14:13:41 -04:00
{
get
{
if ( DetectedTargets = = null )
{
AutodetectSettings ( false ) ;
}
return DetectedTargets ;
}
}
2014-05-29 17:38:00 -04:00
/// <summary>
/// List of all Engine ini files for this project
/// </summary>
2016-12-13 11:58:16 -05:00
public Dictionary < UnrealTargetPlatform , ConfigHierarchy > EngineConfigs
2014-05-29 17:38:00 -04:00
{
get
{
if ( LoadedEngineConfigs = = null )
{
AutodetectSettings ( false ) ;
}
return LoadedEngineConfigs ;
}
}
/// <summary>
/// List of all Game ini files for this project
/// </summary>
2016-12-13 11:58:16 -05:00
public Dictionary < UnrealTargetPlatform , ConfigHierarchy > GameConfigs
2014-05-29 17:38:00 -04:00
{
get
{
if ( LoadedGameConfigs = = null )
{
AutodetectSettings ( false ) ;
}
return LoadedGameConfigs ;
}
}
2014-03-14 14:13:41 -04:00
public void Validate ( )
{
2015-09-26 14:41:15 -04:00
if ( RawProjectPath = = null )
2014-03-14 14:13:41 -04:00
{
throw new AutomationException ( "RawProjectPath can't be empty." ) ;
}
2015-09-26 14:41:15 -04:00
if ( ! RawProjectPath . HasExtension ( ".uproject" ) )
2014-10-27 19:33:51 -04:00
{
throw new AutomationException ( "RawProjectPath {0} must end with .uproject" , RawProjectPath ) ;
}
2017-03-14 15:48:33 -04:00
if ( ! CommandUtils . FileExists ( RawProjectPath . FullName ) )
2014-10-27 19:33:51 -04:00
{
throw new AutomationException ( "RawProjectPath {0} file must exist" , RawProjectPath ) ;
}
2014-03-14 14:13:41 -04:00
if ( FileServer & & ! Cook )
{
throw new AutomationException ( "Only cooked builds can use a fileserver be staged, use -cook" ) ;
}
2018-02-22 11:25:06 -05:00
if ( Stage & & ! SkipStage & & ! Cook & & ! CookOnTheFly & & ! IsProgramTarget )
2014-03-14 14:13:41 -04:00
{
throw new AutomationException ( "Only cooked builds or programs can be staged, use -cook or -cookonthefly." ) ;
}
if ( Manifests & & ! Cook & & ! Stage & & ! Pak )
{
throw new AutomationException ( "Only staged pakd and cooked builds can generate streaming install manifests" ) ;
}
if ( Pak & & ! Stage )
{
throw new AutomationException ( "Only staged builds can be paked, use -stage or -skipstage." ) ;
}
2014-10-27 19:33:51 -04:00
if ( Deploy & & ! Stage )
{
throw new AutomationException ( "Only staged builds can be deployed, use -stage or -skipstage." ) ;
}
2014-03-14 14:13:41 -04:00
2014-10-27 19:33:51 -04:00
if ( ( Pak | | Stage | | Cook | | CookOnTheFly | | FileServer | | DedicatedServer ) & & EditorTest )
{
throw new AutomationException ( "None of pak, stage, cook, CookOnTheFly or DedicatedServer can be used with EditorTest" ) ;
}
2014-03-14 14:13:41 -04:00
2014-10-27 19:33:51 -04:00
if ( DedicatedServer & & RunAutomationTests )
{
throw new AutomationException ( "DedicatedServer cannot be used with RunAutomationTests" ) ;
}
2014-03-14 14:13:41 -04:00
if ( ( CookOnTheFly | | FileServer ) & & DedicatedServer )
{
throw new AutomationException ( "Don't use either -cookonthefly or -fileserver with -server." ) ;
}
if ( NoClient & & ! DedicatedServer & & ! CookOnTheFly )
{
throw new AutomationException ( "-noclient can only be used with -server or -cookonthefly." ) ;
}
if ( Build & & ! HasCookedTargets & & ! HasEditorTargets & & ! HasProgramTargets )
{
throw new AutomationException ( "-build is specified but there are no targets to build." ) ;
}
if ( Pak & & FileServer )
{
throw new AutomationException ( "Can't use -pak and -fileserver at the same time." ) ;
}
if ( Cook & & CookOnTheFly )
{
2015-03-30 11:56:48 -04:00
throw new AutomationException ( "Can't use both -cook and -cookonthefly." ) ;
2014-03-14 14:13:41 -04:00
}
2014-06-18 08:20:44 -04:00
2015-04-20 11:15:20 -04:00
if ( ! HasDLCName & & DLCIncludeEngineContent )
{
2017-11-09 18:22:55 -05:00
throw new AutomationException ( "DLCIncludeEngineContent flag is only valid when building DLC." ) ;
}
if ( ! HasDLCName & & DLCPakPluginFile )
{
throw new AutomationException ( "DLCPakPluginFile flag is only valid when building DLC." ) ;
2015-04-20 11:15:20 -04:00
}
2017-06-21 17:09:40 -04:00
if ( ( IsGeneratingPatch | | HasDLCName | | ShouldAddPatchLevel ) & & ! HasBasedOnReleaseVersion )
2015-03-30 11:56:48 -04:00
{
throw new AutomationException ( "Require based on release version to build patches or dlc" ) ;
}
2017-06-21 17:09:40 -04:00
if ( ShouldAddPatchLevel & & ! IsGeneratingPatch )
{
throw new AutomationException ( "Creating a new patch tier requires patch generation" ) ;
}
if ( ShouldStageBaseReleasePaks & & ! HasBasedOnReleaseVersion )
{
throw new AutomationException ( "Staging pak files from the base release requires a base release version" ) ;
}
if ( HasCreateReleaseVersion & & HasDLCName )
2015-03-30 11:56:48 -04:00
{
throw new AutomationException ( "Can't create a release version at the same time as creating dlc." ) ;
}
2018-05-23 21:04:31 -04:00
if ( HasBasedOnReleaseVersion & & ( IterativeCooking | | IterativeDeploy | | HasIterateSharedCookedBuild ) )
2015-03-30 11:56:48 -04:00
{
throw new AutomationException ( "Can't use iterative cooking / deploy on dlc or patching or creating a release" ) ;
}
2015-02-13 15:29:05 -05:00
/*if (Compressed && !Pak)
2014-10-27 19:33:51 -04:00
{
throw new AutomationException("-compressed can only be used with -pak");
2015-02-13 15:29:05 -05:00
}*/
2014-08-01 11:07:46 -04:00
2016-07-19 19:13:01 -04:00
if ( CreateChunkInstall & & ( ! ( Manifests | | HasDLCName ) | | ! Stage ) )
2014-10-27 19:33:51 -04:00
{
2015-04-02 04:22:48 -04:00
throw new AutomationException ( "-createchunkinstall can only be used with -manifests & -stage" ) ;
2014-10-27 19:33:51 -04:00
}
2015-04-02 04:22:48 -04:00
if ( CreateChunkInstall & & String . IsNullOrEmpty ( ChunkInstallDirectory ) )
{
throw new AutomationException ( "-createchunkinstall must specify the chunk install data directory with -chunkinstalldirectory=" ) ;
}
if ( CreateChunkInstall & & String . IsNullOrEmpty ( ChunkInstallVersionString ) )
{
throw new AutomationException ( "-createchunkinstall must specify the chunk install data version string with -chunkinstallversion=" ) ;
}
2017-12-05 21:57:41 -05:00
2018-05-23 21:04:31 -04:00
/*if(IsGeneratingRemaster && string.IsNullOrEmpty(DiscVersion))
2017-12-05 21:57:41 -05:00
{
throw new AutomationException("DiscVersion is required for generating remaster package.");
2018-05-23 21:04:31 -04:00
}*/
2014-03-14 14:13:41 -04:00
}
protected bool bLogged = false ;
public virtual void ValidateAndLog ( )
{
// Avoid spamming, log only once
if ( ! bLogged )
{
// In alphabetical order.
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "Project Params **************" ) ;
2014-03-14 14:13:41 -04:00
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "AdditionalServerMapParams={0}" , AdditionalServerMapParams ) ;
CommandUtils . LogLog ( "Archive={0}" , Archive ) ;
CommandUtils . LogLog ( "ArchiveMetaData={0}" , ArchiveMetaData ) ;
CommandUtils . LogLog ( "CreateAppBundle={0}" , CreateAppBundle ) ;
CommandUtils . LogLog ( "BaseArchiveDirectory={0}" , BaseArchiveDirectory ) ;
CommandUtils . LogLog ( "BaseStageDirectory={0}" , BaseStageDirectory ) ;
CommandUtils . LogLog ( "Build={0}" , Build ) ;
2017-05-16 13:13:20 -04:00
CommandUtils . LogLog ( "SkipBuildClient={0}" , SkipBuildClient ) ;
CommandUtils . LogLog ( "SkipBuildEditor={0}" , SkipBuildEditor ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "Cook={0}" , Cook ) ;
CommandUtils . LogLog ( "Clean={0}" , Clean ) ;
2019-09-13 13:29:44 -04:00
CommandUtils . LogLog ( "Client={0}" , Client ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "ClientConfigsToBuild={0}" , string . Join ( "," , ClientConfigsToBuild ) ) ;
CommandUtils . LogLog ( "ClientCookedTargets={0}" , ClientCookedTargets . ToString ( ) ) ;
CommandUtils . LogLog ( "ClientTargetPlatform={0}" , string . Join ( "," , ClientTargetPlatforms ) ) ;
CommandUtils . LogLog ( "Compressed={0}" , Compressed ) ;
2018-05-23 21:04:31 -04:00
CommandUtils . LogLog ( "AdditionalPakOptions={0}" , AdditionalPakOptions ) ;
2020-09-01 14:07:48 -04:00
CommandUtils . LogLog ( "AdditionalIoStoreOptions={0}" , AdditionalIoStoreOptions ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "CookOnTheFly={0}" , CookOnTheFly ) ;
CommandUtils . LogLog ( "CookOnTheFlyStreaming={0}" , CookOnTheFlyStreaming ) ;
CommandUtils . LogLog ( "UnversionedCookedContent={0}" , UnversionedCookedContent ) ;
CommandUtils . LogLog ( "SkipCookingEditorContent={0}" , SkipCookingEditorContent ) ;
CommandUtils . LogLog ( "NumCookersToSpawn={0}" , NumCookersToSpawn ) ;
2017-11-09 18:22:55 -05:00
CommandUtils . LogLog ( "GeneratePatch={0}" , GeneratePatch ) ;
2017-06-21 17:09:40 -04:00
CommandUtils . LogLog ( "AddPatchLevel={0}" , AddPatchLevel ) ;
CommandUtils . LogLog ( "StageBaseReleasePaks={0}" , StageBaseReleasePaks ) ;
2017-08-03 14:06:31 -04:00
CommandUtils . LogLog ( "GenerateRemaster={0}" , GenerateRemaster ) ;
2017-12-05 21:57:41 -05:00
CommandUtils . LogLog ( "DiscVersion={0}" , DiscVersion ) ;
CommandUtils . LogLog ( "CreateReleaseVersion={0}" , CreateReleaseVersion ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "BasedOnReleaseVersion={0}" , BasedOnReleaseVersion ) ;
2017-07-21 12:42:36 -04:00
CommandUtils . LogLog ( "DLCFile={0}" , DLCFile ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "DLCIncludeEngineContent={0}" , DLCIncludeEngineContent ) ;
2017-11-09 18:22:55 -05:00
CommandUtils . LogLog ( "DLCPakPluginFile={0}" , DLCPakPluginFile ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "DiffCookedContentPath={0}" , DiffCookedContentPath ) ;
CommandUtils . LogLog ( "AdditionalCookerOptions={0}" , AdditionalCookerOptions ) ;
2019-09-13 13:29:44 -04:00
CommandUtils . LogLog ( "DedicatedServer={0}" , DedicatedServer ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "DirectoriesToCook={0}" , DirectoriesToCook . ToString ( ) ) ;
2020-09-24 00:43:27 -04:00
CommandUtils . LogLog ( "DDCGraph={0}" , DDCGraph ) ;
2016-01-08 19:10:43 -05:00
CommandUtils . LogLog ( "CulturesToCook={0}" , CommandUtils . IsNullOrEmpty ( CulturesToCook ) ? "<Not Specified> (Use Defaults)" : CulturesToCook . ToString ( ) ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "EditorTargets={0}" , EditorTargets . ToString ( ) ) ;
CommandUtils . LogLog ( "Foreign={0}" , Foreign ) ;
CommandUtils . LogLog ( "IsCodeBasedProject={0}" , IsCodeBasedProject . ToString ( ) ) ;
CommandUtils . LogLog ( "IsProgramTarget={0}" , IsProgramTarget . ToString ( ) ) ;
CommandUtils . LogLog ( "IterativeCooking={0}" , IterativeCooking ) ;
2016-11-21 20:27:58 -05:00
CommandUtils . LogLog ( "IterateSharedCookedBuild={0}" , IterateSharedCookedBuild ) ;
2017-05-16 13:13:20 -04:00
CommandUtils . LogLog ( "IterateSharedBuildUsePrecompiledExe={0}" , IterateSharedBuildUsePrecompiledExe ) ;
2016-11-21 20:27:58 -05:00
CommandUtils . LogLog ( "CookAll={0}" , CookAll ) ;
2016-09-09 20:13:41 -04:00
CommandUtils . LogLog ( "CookPartialGC={0}" , CookPartialGC ) ;
2016-11-21 20:27:58 -05:00
CommandUtils . LogLog ( "CookInEditor={0}" , CookInEditor ) ;
CommandUtils . LogLog ( "CookMapsOnly={0}" , CookMapsOnly ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "Deploy={0}" , Deploy ) ;
CommandUtils . LogLog ( "IterativeDeploy={0}" , IterativeDeploy ) ;
CommandUtils . LogLog ( "FastCook={0}" , FastCook ) ;
CommandUtils . LogLog ( "LogWindow={0}" , LogWindow ) ;
CommandUtils . LogLog ( "Manifests={0}" , Manifests ) ;
CommandUtils . LogLog ( "MapToRun={0}" , MapToRun ) ;
CommandUtils . LogLog ( "NoClient={0}" , NoClient ) ;
CommandUtils . LogLog ( "NumClients={0}" , NumClients ) ;
CommandUtils . LogLog ( "NoDebugInfo={0}" , NoDebugInfo ) ;
2018-02-22 11:25:06 -05:00
CommandUtils . LogLog ( "SeparateDebugInfo={0}" , SeparateDebugInfo ) ;
2017-05-03 14:18:32 -04:00
CommandUtils . LogLog ( "MapFile={0}" , MapFile ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "NoCleanStage={0}" , NoCleanStage ) ;
CommandUtils . LogLog ( "NoXGE={0}" , NoXGE ) ;
CommandUtils . LogLog ( "MapsToCook={0}" , MapsToCook . ToString ( ) ) ;
2017-01-27 23:32:44 -05:00
CommandUtils . LogLog ( "MapIniSectionsToCook={0}" , MapIniSectionsToCook . ToString ( ) ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "Pak={0}" , Pak ) ;
2020-02-27 20:59:51 -05:00
CommandUtils . LogLog ( "IgnorePaksFromDifferentCookSource={0}" , IgnorePaksFromDifferentCookSource ) ;
2019-11-25 12:03:09 -05:00
CommandUtils . LogLog ( "IoStore={0}" , IoStore ) ;
2020-02-06 13:13:41 -05:00
CommandUtils . LogLog ( "SkipIoStore={0}" , SkipIoStore ) ;
2020-04-10 11:30:32 -04:00
CommandUtils . LogLog ( "SkipPackage={0}" , SkipPackage ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "Package={0}" , Package ) ;
2018-02-22 11:25:06 -05:00
CommandUtils . LogLog ( "ForcePackageData={0}" , ForcePackageData ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "NullRHI={0}" , NullRHI ) ;
CommandUtils . LogLog ( "FakeClient={0}" , FakeClient ) ;
CommandUtils . LogLog ( "EditorTest={0}" , EditorTest ) ;
CommandUtils . LogLog ( "RunAutomationTests={0}" , RunAutomationTests ) ;
CommandUtils . LogLog ( "RunAutomationTest={0}" , RunAutomationTest ) ;
CommandUtils . LogLog ( "RunTimeoutSeconds={0}" , RunTimeoutSeconds ) ;
CommandUtils . LogLog ( "CrashIndex={0}" , CrashIndex ) ;
CommandUtils . LogLog ( "ProgramTargets={0}" , ProgramTargets . ToString ( ) ) ;
2017-12-12 18:32:45 -05:00
CommandUtils . LogLog ( "ProjectPlatformBinariesPaths={0}" , string . Join ( "," , ProjectPlatformBinariesPaths ) ) ;
CommandUtils . LogLog ( "ProjectExePaths={0}" , string . Join ( "," , ProjectExePaths ) ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "Distribution={0}" , Distribution ) ;
CommandUtils . LogLog ( "Prebuilt={0}" , Prebuilt ) ;
CommandUtils . LogLog ( "Prereqs={0}" , Prereqs ) ;
2016-07-12 15:06:08 -04:00
CommandUtils . LogLog ( "AppLocalDirectory={0}" , AppLocalDirectory ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "NoBootstrapExe={0}" , NoBootstrapExe ) ;
CommandUtils . LogLog ( "RawProjectPath={0}" , RawProjectPath ) ;
CommandUtils . LogLog ( "Run={0}" , Run ) ;
CommandUtils . LogLog ( "ServerConfigsToBuild={0}" , string . Join ( "," , ServerConfigsToBuild ) ) ;
CommandUtils . LogLog ( "ServerCookedTargets={0}" , ServerCookedTargets . ToString ( ) ) ;
CommandUtils . LogLog ( "ServerTargetPlatform={0}" , string . Join ( "," , ServerTargetPlatforms ) ) ;
CommandUtils . LogLog ( "ShortProjectName={0}" , ShortProjectName . ToString ( ) ) ;
CommandUtils . LogLog ( "SignedPak={0}" , SignedPak ) ;
CommandUtils . LogLog ( "SignPak={0}" , SignPak ) ;
CommandUtils . LogLog ( "SkipCook={0}" , SkipCook ) ;
CommandUtils . LogLog ( "SkipCookOnTheFly={0}" , SkipCookOnTheFly ) ;
CommandUtils . LogLog ( "SkipPak={0}" , SkipPak ) ;
2018-02-22 11:25:06 -05:00
CommandUtils . LogLog ( "PrePak={0}" , PrePak ) ;
CommandUtils . LogLog ( "SkipStage={0}" , SkipStage ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "Stage={0}" , Stage ) ;
2016-03-14 21:21:09 -04:00
CommandUtils . LogLog ( "bTreatNonShippingBinariesAsDebugFiles={0}" , bTreatNonShippingBinariesAsDebugFiles ) ;
2018-02-22 11:25:06 -05:00
CommandUtils . LogLog ( "bUseExtraFlavor={0}" , bUseExtraFlavor ) ;
CommandUtils . LogLog ( "NativizeAssets={0}" , RunAssetNativization ) ;
CommandUtils . LogLog ( "StageDirectoryParam={0}" , StageDirectoryParam ) ;
2018-11-14 19:05:13 -05:00
CommandUtils . LogLog ( "AdditionalPackageOptions={0}" , AdditionalPackageOptions ) ;
2015-08-20 09:37:11 -04:00
CommandUtils . LogLog ( "Project Params **************" ) ;
2014-03-14 14:13:41 -04:00
}
bLogged = true ;
Validate ( ) ;
}
}
}