using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UnrealBuildTool; namespace AutomationTool.Tasks { /// /// Parameters for the error task /// public class ErrorTaskParameters { /// /// Message to display before failing /// [TaskParameter(Optional = true)] public string Message; } /// /// Task which outputs and error message and fails the build. /// [TaskElement("Error", typeof(ErrorTaskParameters))] public class ErrorTask : CustomTask { /// /// Parameters for this task /// ErrorTaskParameters Parameters; /// /// Constructor /// /// Parameters for this task public ErrorTask(ErrorTaskParameters InParameters) { Parameters = InParameters; } /// /// Execute the task. /// /// Information about the current job /// Set of build products produced by this node. /// Mapping from tag names to the set of files they include /// True if the task succeeded public override bool Execute(JobContext Job, HashSet BuildProducts, Dictionary> TagNameToFileSet) { if(!String.IsNullOrEmpty(Parameters.Message)) { CommandUtils.LogError(Parameters.Message); } return false; } } }