Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Scripts/DeployCommand.Automation.cs
Jeff Campeau 0ed0f2697e fix for spaces in path on xbox one
fix to fall back to appxmanifest based on executable directory for content only projects on deploy

[CL 2071596 by Jeff Campeau in Main branch]
2014-05-13 10:50:28 -04:00

71 lines
2.0 KiB
C#

// Copyright 1998-2014 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;
public partial class Project : CommandUtils
{
#region Deploy Command
public static void Deploy(ProjectParams Params)
{
Params.ValidateAndLog();
if (!Params.Deploy)
{
return;
}
if (!Params.NoClient)
{
var DeployContextList = CreateDeploymentContext(Params, false, false);
foreach ( var SC in DeployContextList )
{
if (SC.StageTargetPlatform.DeployViaUFE)
{
string ClientCmdLine = "-run=Deploy ";
ClientCmdLine += "-Device=" + Params.Device + " ";
ClientCmdLine += "-Targetplatform=" + SC.StageTargetPlatform.PlatformType.ToString() + " ";
ClientCmdLine += "-SourceDir=\"" + CombinePaths(Params.BaseStageDirectory, SC.StageTargetPlatform.PlatformType.ToString()) + "\" ";
string ClientApp = CombinePaths(CmdEnv.LocalRoot, "Engine/Binaries/Win64/UnrealFrontend.exe");
Log("Deploying via UFE:");
Log("\tClientCmdLine: " + ClientCmdLine + "");
//@todo UAT: Consolidate running of external applications like UFE (See 'RunProjectCommand' for other instances)
PushDir(Path.GetDirectoryName(ClientApp));
// Always start client process and don't wait for exit.
ProcessResult ClientProcess = Run(ClientApp, ClientCmdLine, null, ERunOptions.NoWaitForExit);
PopDir();
if (ClientProcess != null)
{
do
{
Thread.Sleep(100);
}
while (ClientProcess.HasExited == false);
}
}
else
{
SC.StageTargetPlatform.Deploy(Params, SC);
}
}
}
if (Params.DedicatedServer)
{
ProjectParams ServerParams = new ProjectParams(Params);
ServerParams.Device = ServerParams.ServerDevice;
var DeployContextList = CreateDeploymentContext(ServerParams, true, false);
foreach ( var SC in DeployContextList )
{
SC.StageTargetPlatform.Deploy(ServerParams, SC);
}
}
}
#endregion
}