// Copyright Epic Games, Inc. All Rights Reserved.
using EpicGames.Core;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace EpicGames.BuildGraph
{
///
/// A task invocation
///
public class BgTask
{
///
/// Line number in a source file that this task was declared. Optional; used for log messages.
///
public BgScriptLocation Location { get; }
///
/// Name of the task
///
public string Name { get; set; }
///
/// Arguments for the task
///
public Dictionary Arguments { get; } = new Dictionary();
///
/// Constructor
///
public BgTask(BgScriptLocation Location, string Name)
{
this.Location = Location;
this.Name = Name;
}
///
/// Write to an xml file
///
///
public void Write(XmlWriter Writer)
{
Writer.WriteStartElement(Name);
foreach (KeyValuePair Argument in Arguments)
{
Writer.WriteAttributeString(Argument.Key, Argument.Value);
}
Writer.WriteEndElement();
}
}
}