30 instantiations of TargetResult
Microsoft.Build (7)
BackEnd\Components\ProjectCache\CacheResult.cs (1)
116
new
TargetResult
(
BackEnd\Components\RequestBuilder\TargetBuilder.cs (2)
271
results[i] = new
TargetResult
(Array.Empty<TaskItem>(), new WorkUnitResult(WorkUnitResultCode.Skipped, WorkUnitActionCode.Continue, null));
293
results[i] = new
TargetResult
(Array.Empty<TaskItem>(), new WorkUnitResult(WorkUnitResultCode.Skipped, WorkUnitActionCode.Continue, null));
BackEnd\Components\RequestBuilder\TargetEntry.cs (3)
369
_targetResult = new
TargetResult
(
675
_targetResult = new
TargetResult
(targetOutputItems, aggregateResult, targetLoggingContext?.BuildEventContext);
732
_targetResult = new
TargetResult
(Array.Empty<TaskItem>(), new WorkUnitResult(WorkUnitResultCode.Failed, WorkUnitActionCode.Stop, null));
BackEnd\Shared\TargetResult.cs (1)
205
return new
TargetResult
(translator);
Microsoft.Build.Engine.UnitTests (23)
BackEnd\BuildRequestEngine_Tests.cs (1)
163
result.AddResultsForTarget(target, new
TargetResult
(new TaskItem[1] { new TaskItem("include", _entry.RequestConfiguration.ProjectFullPath) }, completeSuccess ? BuildResultUtilities.GetSuccessResult() : BuildResultUtilities.GetStopWithErrorResult()));
BackEnd\BuildResult_Tests.cs (4)
101
result.AddResultsForTarget("bar", new
TargetResult
(Array.Empty<TaskItem>(), new WorkUnitResult(WorkUnitResultCode.Success, WorkUnitActionCode.Continue, new Exception())));
104
result.AddResultsForTarget("baz", new
TargetResult
(Array.Empty<TaskItem>(), BuildResultUtilities.GetStopWithErrorResult(new Exception())));
323
result.AddResultsForTarget("alpha", new
TargetResult
(new TaskItem[] { fooTaskItem }, BuildResultUtilities.GetSuccessResult()));
324
result.AddResultsForTarget("omega", new
TargetResult
(Array.Empty<TaskItem>(), BuildResultUtilities.GetStopWithErrorResult(new ArgumentException("The argument was invalid"))));
BackEnd\CacheSerialization_Tests.cs (5)
54
new
TargetResult
(
59
new
TargetResult
(
64
new
TargetResult
(
70
new
TargetResult
(
76
new
TargetResult
(
BackEnd\RequestBuilder_Tests.cs (1)
323
return new
TargetResult
(Array.Empty<TaskItem>(), new WorkUnitResult(WorkUnitResultCode.Success, WorkUnitActionCode.Continue, null));
BackEnd\Scheduler_Tests.cs (1)
777
result.AddResultsForTarget(target, new
TargetResult
(Array.Empty<TaskItem>(), workUnitResult));
BackEnd\TargetResult_Tests.cs (7)
28
TargetResult result = new
TargetResult
(Array.Empty<TaskItem>(), BuildResultUtilities.GetStopWithErrorResult());
41
TargetResult result = new
TargetResult
(new TaskItem[] { item }, BuildResultUtilities.GetStopWithErrorResult());
55
TargetResult result = new
TargetResult
(null, BuildResultUtilities.GetStopWithErrorResult());
65
TargetResult result = new
TargetResult
(new TaskItem[] { item }, BuildResultUtilities.GetStopWithErrorResult(new ArgumentException()));
79
TargetResult result = new
TargetResult
(new TaskItem[] { item }, BuildResultUtilities.GetStopWithErrorResult());
95
TargetResult result = new
TargetResult
(
118
TargetResult result = new
TargetResult
(new TaskItem[] { item }, BuildResultUtilities.GetStopWithErrorResult(new BuildAbortedException()));
BackEnd\TaskHost_Tests.cs (1)
83
buildResult.AddResultsForTarget("Build", new
TargetResult
(new TaskItem[] { new TaskItem("IamSuper", configuration.ProjectFullPath) }, BuildResultUtilities.GetSkippedResult()));
BuildResultUtilities.cs (3)
17
return new
TargetResult
(Array.Empty<TaskItem>(), BuildResultUtilities.GetStopWithErrorResult());
22
return new
TargetResult
(Array.Empty<TaskItem>(), BuildResultUtilities.GetSuccessResult());
27
return new
TargetResult
(new TaskItem[1] { new TaskItem("i", "v") }, BuildResultUtilities.GetSuccessResult());
107 references to TargetResult
Microsoft.Build (38)
BackEnd\BuildManager\BuildManager.cs (1)
2303
foreach (var cacheResultInner in cacheResult.BuildResult?.ResultsByTarget ?? Enumerable.Empty<KeyValuePair<string,
TargetResult
>>())
BackEnd\Components\Logging\NodeLoggingContext.cs (1)
112
OriginalBuildEventContext = (targetResult as
TargetResult
)?.OriginalBuildEventContext
BackEnd\Components\RequestBuilder\RequestBuilder.cs (1)
1243
var
proxyTargetResult = resultFromTargetBuilder.ResultsByTarget[proxyTarget];
BackEnd\Components\RequestBuilder\TargetBuilder.cs (7)
247
ITargetResult[] results = new
TargetResult
[targets.Length];
515
TargetResult
targetResult = currentTargetEntry.GatherResults();
551
TargetResult
targetResult = _buildResult[currentTargetEntry.Name] as
TargetResult
;
607
private void PopDependencyTargetsOnTargetFailure(TargetEntry topEntry,
TargetResult
targetResult, ref bool stopProcessingStack)
784
if (_buildResult.ResultsByTarget.TryGetValue(targetName.name, out
TargetResult
targetBuildResult))
801
_buildResult.ResultsByTarget.TryGetValue(afterTarget.TargetName, out
TargetResult
result);
BackEnd\Components\RequestBuilder\TargetEntry.cs (3)
104
private
TargetResult
_targetResult;
249
internal
TargetResult
Result
744
internal
TargetResult
GatherResults()
BackEnd\Components\RequestBuilder\TaskHost.cs (1)
1226
foreach (KeyValuePair<string,
TargetResult
> resultEntry in results[i].ResultsByTarget)
BackEnd\Shared\BuildResult.cs (15)
78
private ConcurrentDictionary<string,
TargetResult
> _resultsByTarget;
383
foreach (KeyValuePair<string,
TargetResult
> result in _resultsByTarget ?? [])
399
public IDictionary<string,
TargetResult
> ResultsByTarget
524
public void AddResultsForTarget(string target,
TargetResult
result)
534
if (_resultsByTarget.TryGetValue(target, out
TargetResult
? targetResult))
577
foreach (KeyValuePair<string,
TargetResult
> targetResult in results._resultsByTarget ?? [])
621
translator.TranslateDictionary(ref _resultsByTarget,
TargetResult
.FactoryForDeserialization, CreateTargetResultDictionary);
699
foreach (KeyValuePair<string,
TargetResult
> targetResultPair in _resultsByTarget ?? [])
710
string resultsDirectory =
TargetResult
.GetCacheDirectory(_configurationId, "None" /*Does not matter because we just need the directory name not the file*/);
730
_resultsByTarget = new ConcurrentDictionary<string,
TargetResult
>(_resultsByTarget, StringComparer.OrdinalIgnoreCase),
750
private static ConcurrentDictionary<string,
TargetResult
> CreateTargetResultDictionary(int capacity)
752
return new ConcurrentDictionary<string,
TargetResult
>(1, capacity, StringComparer.OrdinalIgnoreCase);
759
private static ConcurrentDictionary<string,
TargetResult
> CreateTargetResultDictionaryWithContents(BuildResult existingResults, string[] targetNames)
761
ConcurrentDictionary<string,
TargetResult
> resultsByTarget = CreateTargetResultDictionary(targetNames.Length);
765
if (existingResults.ResultsByTarget?.TryGetValue(target, out
TargetResult
? targetResult) ?? false)
BackEnd\Shared\IBuildResults.cs (1)
30
IDictionary<string,
TargetResult
> ResultsByTarget { get; }
BackEnd\Shared\TargetResult.cs (3)
60
/// Non-null when creating a <see cref="
TargetResult
"/> after building the target initially (or skipping due to false condition).
61
/// Null when the <see cref="
TargetResult
"/> is being created in other scenarios:
203
internal static
TargetResult
FactoryForDeserialization(ITranslator translator)
Instance\ProjectInstance.cs (5)
2189
IDictionary<string,
TargetResult
> targetOutputs;
2205
public bool Build(string[] targets, IEnumerable<ILogger> loggers, out IDictionary<string,
TargetResult
> targetOutputs)
2222
public bool Build(string[] targets, IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers, out IDictionary<string,
TargetResult
> targetOutputs)
2681
internal bool Build(string[] targets, IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers, ILoggingService loggingService, int maxNodeCount, out IDictionary<string,
TargetResult
> targetOutputs)
2731
internal bool Build(string[] targets, IEnumerable<ILogger> loggers, IEnumerable<ForwardingLoggerRecord> remoteLoggers, ILoggingService loggingService, out IDictionary<string,
TargetResult
> targetOutputs)
Microsoft.Build.Engine.UnitTests (47)
BackEnd\BuildManager_Tests.cs (1)
449
TargetResult
targetresult = result.ResultsByTarget["test"];
BackEnd\BuildResult_Tests.cs (2)
267
foreach (KeyValuePair<string,
TargetResult
> resultPair in result.ResultsByTarget)
287
foreach (KeyValuePair<string,
TargetResult
> resultPair in result.ResultsByTarget)
BackEnd\MSBuild_Tests.cs (8)
144
IDictionary<string,
TargetResult
> targetOutputs;
557
IDictionary<string,
TargetResult
> targetOutputs;
626
IDictionary<string,
TargetResult
> targetOutputs;
933
IDictionary<string,
TargetResult
> targetOutputs;
1053
IDictionary<string,
TargetResult
> targetOutputs;
1122
IDictionary<string,
TargetResult
> targetOutputs;
1189
IDictionary<string,
TargetResult
> targetOutputs;
1804
IDictionary<string,
TargetResult
> targetOutputs;
BackEnd\RequestBuilder_Tests.cs (1)
321
private
TargetResult
GetEmptySuccessfulTargetResult()
BackEnd\ResultsCache_Tests.cs (4)
448
var
copiedTargetResult = copiedBuildResult.ResultsByTarget[targetKey];
449
var
initialTargetResult = initialBuildResult.ResultsByTarget[targetKey];
484
foreach (KeyValuePair<string,
TargetResult
> targetResult in a.ResultsByTarget)
492
foreach (KeyValuePair<string,
TargetResult
> targetResult in b.ResultsByTarget)
BackEnd\SdkResultOutOfProc_Tests.cs (2)
185
TargetResult
targetresult = result.ResultsByTarget["GetCurrentProcessId"];
197
TargetResult
targetresult = result.ResultsByTarget["GetResolverResults"];
BackEnd\TargetEntry_Tests.cs (9)
362
TargetResult
results = entry.GatherResults();
468
TargetResult
results = entry.GatherResults();
495
TargetResult
results = entry.GatherResults();
513
TargetResult
results = entry.GatherResults();
534
TargetResult
results = entry.GatherResults();
555
TargetResult
results = entry.GatherResults();
576
TargetResult
results = entry.GatherResults();
597
TargetResult
results = entry.GatherResults();
618
TargetResult
results = entry.GatherResults();
BackEnd\TargetResult_Tests.cs (13)
28
TargetResult
result = new TargetResult(Array.Empty<TaskItem>(), BuildResultUtilities.GetStopWithErrorResult());
41
TargetResult
result = new TargetResult(new TaskItem[] { item }, BuildResultUtilities.GetStopWithErrorResult());
55
TargetResult
result = new TargetResult(null, BuildResultUtilities.GetStopWithErrorResult());
65
TargetResult
result = new TargetResult(new TaskItem[] { item }, BuildResultUtilities.GetStopWithErrorResult(new ArgumentException()));
79
TargetResult
result = new TargetResult(new TaskItem[] { item }, BuildResultUtilities.GetStopWithErrorResult());
95
TargetResult
result = new TargetResult(
101
TargetResult
deserializedResult =
TargetResult
.FactoryForDeserialization(TranslationHelpers.GetReadTranslator());
118
TargetResult
result = new TargetResult(new TaskItem[] { item }, BuildResultUtilities.GetStopWithErrorResult(new BuildAbortedException()));
121
TargetResult
deserializedResult =
TargetResult
.FactoryForDeserialization(TranslationHelpers.GetReadTranslator());
139
string path1 =
TargetResult
.GetCacheDirectory(2, "Blah");
142
string path2 =
TargetResult
.GetCacheDirectory(2, "Blah");
BuildResultUtilities.cs (3)
15
public static
TargetResult
GetEmptyFailingTargetResult()
20
public static
TargetResult
GetEmptySucceedingTargetResult()
25
public static
TargetResult
GetNonEmptySucceedingTargetResult()
InternalEngineHelpers.cs (2)
176
internal static void AssertTargetResultsEqual(
TargetResult
a,
TargetResult
b)
ProjectCache\ProjectCacheTests.cs (2)
846
var
targetResult = buildResult.ResultsByTarget!["Build"];
854
var
proxyTargetResult = buildResult.ResultsByTarget["ProxyBuild"];
Microsoft.Build.Tasks.UnitTests (19)
ResolveSDKReference_Tests.cs (19)
3816
IDictionary<string,
TargetResult
> targetResults = new Dictionary<string,
TargetResult
>();
3820
TargetResult
result = targetResults["GetResolvedSDKReferences"];
3825
targetResults = new Dictionary<string,
TargetResult
>();
3959
IDictionary<string,
TargetResult
> targetResults = new Dictionary<string,
TargetResult
>();
3963
TargetResult
result = targetResults["GetResolvedSDKReferences"];
3968
targetResults = new Dictionary<string,
TargetResult
>();
4068
IDictionary<string,
TargetResult
> targetResults = new Dictionary<string,
TargetResult
>();
4072
TargetResult
result = targetResults["GetResolvedSDKReferences"];
4077
targetResults = new Dictionary<string,
TargetResult
>();
4165
IDictionary<string,
TargetResult
> targetResults = new Dictionary<string,
TargetResult
>();
4169
TargetResult
result = targetResults["GetResolvedSDKReferences"];
4176
targetResults = new Dictionary<string,
TargetResult
>();
4334
IDictionary<string,
TargetResult
> targetResults = new Dictionary<string,
TargetResult
>();
4339
TargetResult
result = targetResults["GetResolvedSDKReferences"];
Microsoft.Build.UnitTests.Shared (2)
MockEngine.cs (2)
316
bool success = instance.Build(targetNames, loggers, out IDictionary<string,
TargetResult
> targetOutputs);
322
foreach (KeyValuePair<string,
TargetResult
> resultEntry in targetOutputs)
MSBuild (1)
JsonOutputFormatter.cs (1)
135
TargetResult
targetResult = result.ResultsByTarget![targetName];