// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using System.Xml;
using AutomationTool;
using EpicGames.Core;
namespace AutomationTool.Tasks
{
///
/// Parameters for a wait task
///
public class WaitTaskParameters
{
///
/// Number of seconds to wait.
///
[TaskParameter]
public int Seconds;
}
///
/// Waits a defined number of seconds.
///
[TaskElement("Wait", typeof(WaitTaskParameters))]
public class WaitTask : BgTaskImpl
{
///
/// Parameters for this task
///
WaitTaskParameters Parameters;
///
/// Construct a wait task
///
/// Parameters for the task
public WaitTask(WaitTaskParameters 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
public override async Task ExecuteAsync(JobContext Job, HashSet BuildProducts, Dictionary> TagNameToFileSet)
{
await Task.Delay(TimeSpan.FromSeconds(Parameters.Seconds));
}
///
/// Output this task out to an XML writer.
///
public override void Write(XmlWriter Writer)
{
Write(Writer, Parameters);
}
///
/// Find all the tags which are used as inputs to this task
///
/// The tag names which are read by this task
public override IEnumerable FindConsumedTagNames()
{
yield break;
}
///
/// Find all the tags which are modified by this task
///
/// The tag names which are modified by this task
public override IEnumerable FindProducedTagNames()
{
yield break;
}
}
}