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