Files
UnrealEngineUWP/Engine/Source/Programs/Shared/EpicGames.BuildGraph/BgTask.cs
ben marsh 5e0d3dfcc5 BuildGraph: Add a dedicated type to store source file location for script messages.
#ROBOMERGE-AUTHOR: ben.marsh
#ROBOMERGE-SOURCE: CL 18210060 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v895-18170469)

[CL 18210074 by ben marsh in ue5-release-engine-test branch]
2021-11-16 14:08:03 -05:00

56 lines
1.2 KiB
C#

// 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
{
/// <summary>
/// A task invocation
/// </summary>
public class BgTask
{
/// <summary>
/// Line number in a source file that this task was declared. Optional; used for log messages.
/// </summary>
public BgScriptLocation Location { get; }
/// <summary>
/// Name of the task
/// </summary>
public string Name { get; set; }
/// <summary>
/// Arguments for the task
/// </summary>
public Dictionary<string, string> Arguments { get; } = new Dictionary<string, string>();
/// <summary>
/// Constructor
/// </summary>
public BgTask(BgScriptLocation Location, string Name)
{
this.Location = Location;
this.Name = Name;
}
/// <summary>
/// Write to an xml file
/// </summary>
/// <param name="Writer"></param>
public void Write(XmlWriter Writer)
{
Writer.WriteStartElement(Name);
foreach (KeyValuePair<string, string> Argument in Arguments)
{
Writer.WriteAttributeString(Argument.Key, Argument.Value);
}
Writer.WriteEndElement();
}
}
}