Skip to content

Commit

Permalink
Merge branch 'main' into concurrentdictionary-count
Browse files Browse the repository at this point in the history
  • Loading branch information
SimaTian authored Jan 8, 2025
2 parents de1c727 + 6ea6901 commit 9002d58
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ private async Task ProcessTargetStack(ITaskBuilder taskBuilder)
// Execute all of the tasks on this target.
MSBuildEventSource.Log.TargetStart(currentTargetEntry.Name);
await currentTargetEntry.ExecuteTarget(taskBuilder, _requestEntry, _projectLoggingContext, _cancellationToken);
MSBuildEventSource.Log.TargetStop(currentTargetEntry.Name, currentTargetEntry.Result?.ResultCode.ToString() ?? string.Empty);
MSBuildEventSource.Log.TargetStop(currentTargetEntry.Name, currentTargetEntry.Result?.TargetResultCodeToString() ?? string.Empty);
}

break;
Expand Down
16 changes: 16 additions & 0 deletions src/Build/BackEnd/Shared/TargetResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,22 @@ public TargetResultCode ResultCode
}
}

public string TargetResultCodeToString()
{
switch (ResultCode)
{
case TargetResultCode.Failure:
return nameof(TargetResultCode.Failure);
case TargetResultCode.Skipped:
return nameof(TargetResultCode.Skipped);
case TargetResultCode.Success:
return nameof(TargetResultCode.Success);
default:
Debug.Fail($"Unknown enum value: {ResultCode}");
return ResultCode.ToString();
}
}

/// <summary>
/// Returns the internal result for the target.
/// </summary>
Expand Down

0 comments on commit 9002d58

Please sign in to comment.