Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/AutomationUtils/BuildCommand.cs
Matthew Griffin bb70b349ce Merging CL 2804086 from //UE4/Release-4.11 to Dev-Main (//UE4/Dev-Main) to isolate copyright update
#lockdown Nick.Penwarden

[CL 2819020 by Matthew Griffin in Main branch]
2016-01-07 08:17:16 -05:00

46 lines
1.1 KiB
C#

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AutomationTool
{
/// <summary>
/// Base class for buildcommands.
/// </summary>
public abstract class BuildCommand : CommandUtils
{
/// <summary>
/// Build command entry point. Throws AutomationExceptions on failure.
/// </summary>
public virtual void ExecuteBuild()
{
throw new AutomationException("Either Execute() or ExecuteBuild() should be implemented for {0}", GetType().Name);
}
/// <summary>
/// Command entry point.
/// </summary>
public virtual ExitCode Execute()
{
ExecuteBuild();
return ExitCode.Success;
}
/// <summary>
/// Executes a new command as a child of another command.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="ParentCommand"></param>
public static ExitCode Execute<T>(BuildCommand ParentCommand) where T : BuildCommand, new()
{
T Command = new T();
if (ParentCommand != null)
{
Command.Params = ParentCommand.Params;
}
return Command.Execute();
}
}
}