// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EpicGames.Core;
#nullable disable
namespace UnrealBuildTool
{
///
/// Invokes the deployment handler for a target.
///
[ToolMode("Deploy", ToolModeOptions.BuildPlatforms)]
class DeployMode : ToolMode
{
///
/// If we are just running the deployment step, specifies the path to the given deployment settings
///
[CommandLine("-Receipt", Required=true)]
public FileReference ReceiptFile = null;
///
/// Execute the tool mode
///
/// Command line arguments
/// Exit code
public override int Execute(CommandLineArguments Arguments)
{
// Apply the arguments
Arguments.ApplyTo(this);
Arguments.CheckAllArgumentsUsed();
// Execute the deploy
TargetReceipt Receipt = TargetReceipt.Read(ReceiptFile);
Log.WriteLine(LogEventType.Console, "Deploying {0} {1} {2}...", Receipt.TargetName, Receipt.Platform, Receipt.Configuration);
UEBuildPlatform.GetBuildPlatform(Receipt.Platform).Deploy(Receipt);
return (int)CompilationResult.Succeeded;
}
}
}