77 references to Targets
Microsoft.Build (17)
BackEnd\BuildManager\BuildManager.cs (1)
1950ProjectErrorUtilities.VerifyThrowInvalidProject(entryPointNode.ProjectInstance.Targets.Count > 0, entryPointNode.ProjectInstance.ProjectFileLocation, "NoTargetSpecified");
BackEnd\Components\RequestBuilder\TargetBuilder.cs (2)
148var targetExists = _projectInstance.Targets.TryGetValue(targetName.name, out ProjectTargetInstance targetInstance); 417_requestEntry.RequestConfiguration.Project.Targets.ContainsKey(currentTargetEntry.Name),
BackEnd\Components\RequestBuilder\TargetEntry.cs (1)
936_requestEntry.RequestConfiguration.Project.Targets.TryGetValue(_targetSpecification.TargetName, out _target);
BackEnd\Shared\BuildRequestConfiguration.cs (3)
186_projectTargets = GetProjectTargets(data.ProjectInstance.Targets); 223_projectTargets = GetProjectTargets(instance.Targets); 418ProjectTargets = GetProjectTargets(_project.Targets);
Construction\Solution\SolutionProjectGenerator.cs (8)
817foreach (string targetName in _targetNames.Where(i => !traversalInstance.Targets.ContainsKey(i))) 831foreach (string targetName in _targetNames.Where(i => !traversalInstance.Targets.ContainsKey(i))) 1017if (traversalInstance.Targets[targetName].Location.File == traversalProject.FullPath) 1237foreach (string targetName in _targetNames.Where(i => !metaprojectInstance.Targets.ContainsKey(i))) 1257foreach (string targetName in _targetNames.Where(i => !metaprojectInstance.Targets.ContainsKey(i))) 1269foreach (string targetName in _targetNames.Where(i => !metaprojectInstance.Targets.ContainsKey(i))) 1803if (metaprojectInstance.Targets.ContainsKey("GetFrameworkPathAndRedistList")) 2027if (traversalProject.Targets.ContainsKey(actualTargetName))
Graph\ProjectInterpretation.cs (1)
531.Where(t => !t.SkipIfNonexistent || projectGraphNode.ProjectInstance.Targets.ContainsKey(t.Target))
Instance\ProjectInstance.cs (1)
2318foreach (ProjectTargetInstance target in Targets.Values)
Microsoft.Build.Engine.OM.UnitTests (8)
Instance\ProjectOnErrorInstance_Tests.cs (1)
49ProjectOnErrorInstance onError = (ProjectOnErrorInstance)instance.Targets["t"].OnErrorChildren[0];
Instance\ProjectTargetInstance_Tests.cs (4)
59ProjectTargetInstance target = instance.Targets["t"]; 79ProjectTargetInstance target = instance.Targets["t;"]; 99ProjectTargetInstance target = instance.Targets["t;"]; 149ProjectTargetInstance target = instance.Targets["t"];
Instance\ProjectTaskInstance_Tests.cs (1)
79ProjectTaskInstance task = (ProjectTaskInstance)(instance.Targets["t"].Children[0]);
Instance\ProjectTaskOutputItemInstance_Tests.cs (1)
52ProjectTaskInstance task = (ProjectTaskInstance)instance.Targets["t"].Children[0];
Instance\ProjectTaskOutputPropertyInstance_Tests.cs (1)
52ProjectTaskInstance task = (ProjectTaskInstance)instance.Targets["t"].Children[0];
Microsoft.Build.Engine.UnitTests (50)
BackEnd\IntrinsicTask_Tests.cs (4)
3955ProjectTargetInstanceChild targetChild = projectInstance.Targets["t"].Children.First(); 3962nodeContext.LogProjectStarted(entry).LogTargetBatchStarted(projectInstance.FullPath, projectInstance.Targets["t"], null, TargetBuiltReason.None), 3990var targetChild = projectInstance.Targets["t"].Children.First(); 3997nodeContext.LogProjectStarted(entry).LogTargetBatchStarted(projectInstance.FullPath, projectInstance.Targets["t"], null, TargetBuiltReason.None),
BackEnd\TargetEntry_Tests.cs (2)
1031TargetEntry entry = new TargetEntry(requestEntry, this, new TargetSpecification(targetName, project.Targets[targetName].Location), lookup, null, TargetBuiltReason.None, _host, null, false); 1047TargetEntry entry = new TargetEntry(requestEntry, this, new TargetSpecification(target, project.Targets[target].Location), baseEntry.Lookup, baseEntry, TargetBuiltReason.None, _host, null, false);
BackEnd\TargetUpToDateChecker_Tests.cs (1)
614TargetUpToDateChecker analyzer = new TargetUpToDateChecker(p, p.Targets["Build"], _mockHost, BuildEventContext.Invalid);
BackEnd\TaskExecutionHost_Tests.cs (1)
1268ProjectTaskInstance taskInstance = project.Targets["foo"].Tasks.First();
Construction\SolutionProjectGenerator_Tests.cs (29)
80instances[0].Targets["Build"].AfterTargets.ShouldBe(string.Empty); 1054Assert.DoesNotContain(projectBravoMetaProject.Targets, kvp => kvp.Value.Outputs.Equals("@()")); // "The outputItem parameter can be null; the Target element should not have an Outputs attribute in that case." 1352foreach (ProjectTargetInstance target in instance.Targets.Values) 1529Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Build", StringComparison.OrdinalIgnoreCase))); 1530Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Clean", StringComparison.OrdinalIgnoreCase))); 1531Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Rebuild", StringComparison.OrdinalIgnoreCase))); 1532Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Publish", StringComparison.OrdinalIgnoreCase))); 1534ProjectTargetInstance buildTarget = instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Build", StringComparison.OrdinalIgnoreCase)).First().Value; 1535ProjectTargetInstance cleanTarget = instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Clean", StringComparison.OrdinalIgnoreCase)).First().Value; 1536ProjectTargetInstance rebuildTarget = instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Rebuild", StringComparison.OrdinalIgnoreCase)).First().Value; 1537ProjectTargetInstance publishTarget = instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Publish", StringComparison.OrdinalIgnoreCase)).First().Value; 1676Assert.Contains("'$(Configuration)' == 'Release'", msbuildProject.Targets["Build"].Condition); 1677Assert.Contains("'$(Configuration)' == 'Debug'", msbuildProject.Targets["Build"].Condition); 2355Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "One", StringComparison.OrdinalIgnoreCase))); 2359Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Two", StringComparison.OrdinalIgnoreCase))); 2360Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Three", StringComparison.OrdinalIgnoreCase))); 2361Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Four", StringComparison.OrdinalIgnoreCase))); 2365Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Build", StringComparison.OrdinalIgnoreCase))); 2369Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Five", StringComparison.OrdinalIgnoreCase))); 2370Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Rebuild", StringComparison.OrdinalIgnoreCase))); 2374Assert.Single(instances[0].Targets.Where(target => String.Equals(target.Value.Name, "Six", StringComparison.OrdinalIgnoreCase))); 2413Assert.True(instances[0].Targets.ContainsKey(targetName)); 2420Assert.True(instances[0].Targets.ContainsKey(traversalTargetName)); 2547Assert.True(projectInstance.Targets.ContainsKey("MyTarget")); 2549Assert.Single(projectInstance.Targets["MyTarget"].Children); 2551ProjectTaskInstance task = Assert.IsType<ProjectTaskInstance>(projectInstance.Targets["MyTarget"].Children[0]); 2608projectInstance.Targets.ShouldContainKey("MyTarget"); 2610projectInstance.Targets["MyTarget"].Children 2615projectInstance.Targets["MyTarget"].BeforeTargets.ShouldBe("DynamicTraversalTarget");
Evaluation\Evaluator_Tests.cs (1)
1429Assert.Equal("3", (Helpers.GetFirst(instance.Targets["t"].Tasks)).GetParameter("Text"));
Instance\ProjectInstance_Internal_Tests.cs (10)
174ProjectPropertyGroupTaskInstance propertyGroup = (ProjectPropertyGroupTaskInstance)(p.Targets["t"].Children[0]); 212ProjectItemGroupTaskInstance itemGroup = (ProjectItemGroupTaskInstance)(p.Targets["t"].Children[0]); 472first.Targets.ShouldBeSameAs(second.Targets); 474first.Targets["t"].ShouldBeSameAs(second.Targets["t"]); 476var firstTasks = first.Targets["t"]; 477var secondTasks = second.Targets["t"]; 789projectInstance.Targets.Count.ShouldBe(2); 790projectInstance.Targets["b"].ShouldBe(targetInstance);
TestComparers\ProjectInstanceModelTestComparers.cs (2)
35x.Targets, 36y.Targets,
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
Build\ProjectBuildManager.cs (2)
244if (!projectInstance.Targets.ContainsKey(target)) 254if (projectInstance.Targets.ContainsKey(target))