3 using SiliconStudio.Core.Serialization.Assets;
5 using System.Collections.Generic;
7 using System.Threading.Tasks;
9 namespace SiliconStudio.BuildEngine
22 public string Module {
get; set; }
30 public int? Priority {
get; set; }
35 public abstract string Title {
get; }
40 public string Description {
get {
return ToString(); } }
50 public bool Processed {
get {
return Status != ResultStatus.NotProcessed; } }
55 public bool Succeeded {
get {
return Status == ResultStatus.Successful || Status == ResultStatus.NotTriggeredWasSuccessful; } }
60 public bool Failed {
get {
return Status == ResultStatus.Failed || Status == ResultStatus.NotTriggeredPrerequisiteFailed; } }
65 public object Tag {
get; set; }
72 private readonly List<BuildStep> prerequisiteSteps =
new List<BuildStep>();
78 protected readonly List<CommandBuildStep> SpawnedStepsList =
new List<CommandBuildStep>();
83 public BuildStep Parent {
get {
return parent; }
protected internal set {
if (parent != null && value != null)
throw new InvalidOperationException(
"BuildStep already has a parent"); parent = value; } }
89 public long ExecutionId {
get;
internal set; }
94 public bool ArePrerequisitesCompleted {
get {
return PrerequisiteSteps.All(x => x.Processed); } }
99 public bool ArePrerequisitesSuccessful {
get {
return PrerequisiteSteps.All(x => x.Succeeded); } }
124 Execute(executeContext, builderContext);
133 public abstract override string ToString();
137 lock (child.prerequisiteSteps)
139 child.prerequisiteSteps.Add(parent);
145 var tcs =
new TaskCompletionSource<BuildStep>();
146 StepProcessed += (sender, e) => tcs.TrySetResult(e.Step);
147 return Processed ? Task.FromResult(
this) : tcs.Task;
161 if (StepProcessed != null)
165 IndexFileCommand.MountDatabases(executeContext);
170 executeContext.Logger.Error(
"Exception in command " +
this +
": " + ex);
174 IndexFileCommand.UnmountDatabases(executeContext);
181 var currentBuildStep =
this;
182 while (currentBuildStep != null)
185 if (enumBuildStep != null)
186 yield
return enumBuildStep.OutputObjects;
187 currentBuildStep = currentBuildStep.Parent;
virtual void Clean(IExecuteContext executeContext, BuilderContext builderContext, bool deleteOutput)
Clean the build, deleting the command cache which is used to determine wheither a command has already...
A BuildStep that can spawn multiple BuildStep. Input and output tracking and merging will be performe...
IEnumerable< IDictionary< ObjectUrl, OutputObject > > GetOutputObjectsGroups()
static void LinkBuildSteps(BuildStep parent, BuildStep child)
EventHandler< BuildStepEventArgs > StepProcessed
Event raised when the command is processed (even if it has been skipped or if it failed) ...
ResultStatus
Status of a command.
BuildStep(ResultStatus status=ResultStatus.NotProcessed)
Task< BuildStep > ExecutedAsync()