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.IO;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using AutomationTool;
|
|
|
|
|
using UnrealBuildTool;
|
|
|
|
|
|
2021-07-22 20:27:06 -04:00
|
|
|
namespace AutomationScripts
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2021-07-22 20:27:06 -04:00
|
|
|
public partial class Project : CommandUtils
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2021-07-22 20:27:06 -04:00
|
|
|
public static void Package(ProjectParams Params, int WorkingCL = -1)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2021-07-22 20:27:06 -04:00
|
|
|
if ((!Params.SkipStage || Params.Package) && !Params.SkipPackage)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2021-07-22 20:27:06 -04:00
|
|
|
Params.ValidateAndLog();
|
|
|
|
|
List<DeploymentContext> DeployContextList = new List<DeploymentContext>();
|
|
|
|
|
if (!Params.NoClient)
|
2016-10-26 14:33:35 -04:00
|
|
|
{
|
2021-07-22 20:27:06 -04:00
|
|
|
DeployContextList.AddRange(CreateDeploymentContext(Params, false, false));
|
|
|
|
|
}
|
|
|
|
|
if (Params.DedicatedServer)
|
|
|
|
|
{
|
|
|
|
|
DeployContextList.AddRange(CreateDeploymentContext(Params, true, false));
|
2016-10-26 14:33:35 -04:00
|
|
|
}
|
|
|
|
|
|
2022-05-05 03:40:01 -04:00
|
|
|
bool bShouldPackage = false;
|
|
|
|
|
foreach (var SC in DeployContextList)
|
|
|
|
|
{
|
|
|
|
|
if (Params.Package || (SC.StageTargetPlatform.RequiresPackageToDeploy && Params.Deploy))
|
|
|
|
|
{
|
|
|
|
|
bShouldPackage = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (bShouldPackage)
|
2021-07-22 20:27:06 -04:00
|
|
|
{
|
|
|
|
|
LogInformation("********** PACKAGE COMMAND STARTED **********");
|
2022-05-05 03:40:01 -04:00
|
|
|
var StartTime = DateTime.UtcNow;
|
2021-07-22 20:27:06 -04:00
|
|
|
|
|
|
|
|
foreach (var SC in DeployContextList)
|
|
|
|
|
{
|
|
|
|
|
if (Params.Package || (SC.StageTargetPlatform.RequiresPackageToDeploy && Params.Deploy))
|
|
|
|
|
{
|
|
|
|
|
SC.StageTargetPlatform.Package(Params, SC, WorkingCL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-05 03:40:01 -04:00
|
|
|
LogInformation("Package command time: {0:0.00} s", (DateTime.UtcNow - StartTime).TotalMilliseconds / 1000);
|
2021-07-22 20:27:06 -04:00
|
|
|
LogInformation("********** PACKAGE COMMAND COMPLETED **********");
|
|
|
|
|
}
|
2016-10-26 14:33:35 -04:00
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|