Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Gauntlet/Unreal/InstallUnrealBuild.cs
mikalai sukhikh 1ddf586476 Provide a UAT command to deploy an archived build
#jira UE-170262
#rb adam.miezianko, chris.constantinescu, jerome.delattre
#preflight 641072b7bd6894c4351cf04d
#preflight 64107260290c6e5d77e5ad30

[CL 24653717 by mikalai sukhikh in ue5-main branch]
2023-03-15 09:52:24 -04:00

59 lines
2.0 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using AutomationTool;
using UnrealBuildBase;
namespace Gauntlet
{
/// <summary>
/// Main class for Unreal Installer script
/// </summary>
[Help("Install Unreal Build onto one or more connected devices using Gauntlet")]
[ParamHelp("platform=<platform>", "Platform to use")]
[ParamHelp("path=<path>", "Path to a build to install")]
[ParamHelp("device=<device>", "Device to install a build on")]
[ParamHelp("devices=<devices>", "List of devices, separated with commas, to install a build on")]
[ParamHelp("commandline=\"-arg1 -arg2 -etc\"", "Commandline to write to UECommandLine.txt on the device")]
[ParamHelp("parallel=[1:4]", "Number of installs to run in parallel",
ParamType = typeof(string), Choices = new string[] { "1", "2", "3", "4" }, DefaultValue = "1")]
[ParamHelp("project=<project>", "Name of the project", Required = true)]
public class InstallUnrealBuild : BuildCommand
{
/// <summary>
/// Entrance point for Unreal Installer script
/// </summary>
/// <returns></returns>
public override ExitCode Execute()
{
string PlatformParam = ParseParamValue("platform", string.Empty);
string BuildPath = ParseParamValue("build", string.Empty);
BuildPath = ParseParamValue("path", BuildPath);
string ProjectName = ParseParamValue("project", string.Empty);
string CommandLine = ParseParamValue("commandline", string.Empty);
string DevicesArg = ParseParamValue("device", string.Empty);
DevicesArg = ParseParamValue("devices", DevicesArg);
int ParallelTasks = Convert.ToInt32(ParseParamValue("parallel", "1"));
bool Success = false;
try
{
Success = InstallUnreal.RunInstall(PlatformParam, BuildPath, ProjectName, CommandLine, DevicesArg, ParallelTasks);
}
catch (Exception Ex)
{
Log.Error("Failed to install build from {Path} to {Device}. {Exception}", BuildPath, DevicesArg, Ex.Message);
}
return Success ? ExitCode.Success : ExitCode.Error_Unknown;
}
}
}