You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
- Allows a target to change how it is packaged, staged and deployed - for example, when packaging for a specific game store Hooked into Windows only at the moment, configured via: [/Script/WindowsTargetPlatform.WindowsTargetSettings] CustomDeployment=MyCustomDeploymentHandler #jira UE-179187 #rnx #rb Eric.McDaniel [CL 27370777 by david harvey in ue5-main branch]
64 lines
1.8 KiB
C#
64 lines
1.8 KiB
C#
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Threading;
|
|
using System.Reflection;
|
|
using AutomationTool;
|
|
using UnrealBuildTool;
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
namespace AutomationScripts
|
|
{
|
|
public partial class Project : CommandUtils
|
|
{
|
|
public static void Package(ProjectParams Params, int WorkingCL = -1)
|
|
{
|
|
if ((!Params.SkipStage || Params.Package) && !Params.SkipPackage)
|
|
{
|
|
Params.ValidateAndLog();
|
|
List<DeploymentContext> DeployContextList = new List<DeploymentContext>();
|
|
if (!Params.NoClient)
|
|
{
|
|
DeployContextList.AddRange(CreateDeploymentContext(Params, false, false));
|
|
}
|
|
if (Params.DedicatedServer)
|
|
{
|
|
DeployContextList.AddRange(CreateDeploymentContext(Params, true, false));
|
|
}
|
|
|
|
bool bShouldPackage = false;
|
|
foreach (var SC in DeployContextList)
|
|
{
|
|
if (Params.Package || (SC.StageTargetPlatform.RequiresPackageToDeploy(Params) && Params.Deploy))
|
|
{
|
|
bShouldPackage = true;
|
|
break;
|
|
}
|
|
}
|
|
|
|
if (bShouldPackage)
|
|
{
|
|
Logger.LogInformation("********** PACKAGE COMMAND STARTED **********");
|
|
var StartTime = DateTime.UtcNow;
|
|
|
|
foreach (var SC in DeployContextList)
|
|
{
|
|
if (Params.Package || (SC.StageTargetPlatform.RequiresPackageToDeploy(Params) && Params.Deploy))
|
|
{
|
|
if (SC.CustomDeployment == null || !SC.CustomDeployment.PrePackage(Params, SC, WorkingCL))
|
|
{
|
|
SC.StageTargetPlatform.Package(Params, SC, WorkingCL);
|
|
}
|
|
SC.CustomDeployment?.PostPackage(Params, SC, WorkingCL);
|
|
}
|
|
}
|
|
|
|
Logger.LogInformation("Package command time: {0:0.00} s", (DateTime.UtcNow - StartTime).TotalMilliseconds / 1000);
|
|
Logger.LogInformation("********** PACKAGE COMMAND COMPLETED **********");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|