3 instantiations of ProjectTargetElement
Microsoft.Build (3)
Construction\ProjectTargetElement.cs (1)
408
return new
ProjectTargetElement
(element, containingProject) { Name = name };
Evaluation\ProjectParser.cs (1)
586
ProjectTargetElement target = new
ProjectTargetElement
(element, _project, _project);
ObjectModelRemoting\LinkedObjectFactory.cs (1)
208
return new
ProjectTargetElement
(link);
174 references to ProjectTargetElement
Microsoft.Build (48)
Construction\ProjectItemElement.cs (6)
189
ErrorUtilities.VerifyThrowInvalidOperation(Parent == null || Parent.Parent is
ProjectTargetElement
|| Parent.Parent is ProjectRootElement, "OM_NoMatchOnMetadataOutsideTargets");
231
ErrorUtilities.VerifyThrowInvalidOperation(Parent == null || Parent.Parent is
ProjectTargetElement
, "OM_NoKeepMetadataOutsideTargets");
252
ErrorUtilities.VerifyThrowInvalidOperation(Parent == null || Parent.Parent is
ProjectTargetElement
, "OM_NoRemoveMetadataOutsideTargets");
273
ErrorUtilities.VerifyThrowInvalidOperation(Parent == null || Parent.Parent is
ProjectTargetElement
, "OM_NoKeepDuplicatesOutsideTargets");
475
ErrorUtilities.VerifyThrowInvalidOperation(parent.Parent is
ProjectTargetElement
|| (Include.Length > 0 || Update.Length > 0 || Remove.Length > 0), "OM_ItemsOutsideTargetMustHaveIncludeOrUpdateOrRemove");
476
ErrorUtilities.VerifyThrowInvalidOperation(parent.Parent is ProjectRootElement || parent.Parent is
ProjectTargetElement
|| parent.Parent is ProjectWhenElement || parent.Parent is ProjectOtherwiseElement, "OM_CannotAcceptParent");
Construction\ProjectItemGroupElement.cs (1)
177
ErrorUtilities.VerifyThrowInvalidOperation(parent is ProjectRootElement || parent is
ProjectTargetElement
|| parent is ProjectWhenElement || parent is ProjectOtherwiseElement, "OM_CannotAcceptParent");
Construction\ProjectOnErrorElement.cs (2)
29
internal ProjectOnErrorElement(XmlElementWithLocation xmlElement,
ProjectTargetElement
parent, ProjectRootElement project)
89
ErrorUtilities.VerifyThrowInvalidOperation(parent is
ProjectTargetElement
, "OM_CannotAcceptParent");
Construction\ProjectPropertyGroupElement.cs (1)
110
ErrorUtilities.VerifyThrowInvalidOperation(parent is ProjectRootElement || parent is
ProjectTargetElement
|| parent is ProjectWhenElement || parent is ProjectOtherwiseElement, "OM_CannotAcceptParent");
Construction\ProjectRootElement.cs (6)
357
public ICollection<
ProjectTargetElement
> Targets => GetChildrenOfType<
ProjectTargetElement
>();
1244
public
ProjectTargetElement
AddTarget(string name)
1246
ProjectTargetElement
target = CreateTargetElement(name);
1441
public
ProjectTargetElement
CreateTargetElement(string name)
1443
return Link != null ? RootLink.CreateTargetElement(name) :
ProjectTargetElement
.CreateDisconnected(name, this);
Construction\ProjectTargetElement.cs (1)
404
internal static
ProjectTargetElement
CreateDisconnected(string name, ProjectRootElement containingProject)
Construction\ProjectTaskElement.cs (2)
46
internal ProjectTaskElement(XmlElementWithLocation xmlElement,
ProjectTargetElement
parent, ProjectRootElement containingProject)
427
ErrorUtilities.VerifyThrowInvalidOperation(parent is
ProjectTargetElement
, "OM_CannotAcceptParent");
Construction\Solution\SolutionProjectGenerator.cs (2)
320
ProjectTargetElement
target,
977
ProjectTargetElement
target = traversalProject.CreateTargetElement(targetName);
Evaluation\Evaluator.cs (16)
101
private readonly List<
ProjectTargetElement
> _targetElements;
253
_targetElements = new List<
ProjectTargetElement
>();
555
private static ProjectTargetInstance ReadNewTargetElement(
ProjectTargetElement
targetElement, bool parentProjectSupportsReturnsAttribute, EvaluationProfiler evaluationProfiler)
764
LinkedList<
ProjectTargetElement
> activeTargetsByEvaluationOrder = new LinkedList<
ProjectTargetElement
>();
765
Dictionary<string, LinkedListNode<
ProjectTargetElement
>> activeTargets = new Dictionary<string, LinkedListNode<
ProjectTargetElement
>>(StringComparer.OrdinalIgnoreCase);
774
var
element = _targetElements[i];
781
foreach (
ProjectTargetElement
target in activeTargetsByEvaluationOrder)
912
case
ProjectTargetElement
target:
1038
private void ReadTargetElement(
ProjectTargetElement
targetElement, LinkedList<
ProjectTargetElement
> activeTargetsByEvaluationOrder, Dictionary<string, LinkedListNode<
ProjectTargetElement
>> activeTargets)
1050
if (activeTargets.TryGetValue(targetName, out LinkedListNode<
ProjectTargetElement
> node))
1062
private void AddBeforeAndAfterTargetMappings(
ProjectTargetElement
targetElement, Dictionary<string, LinkedListNode<
ProjectTargetElement
>> activeTargets, Dictionary<string, List<TargetSpecification>> targetsWhichRunBeforeByTarget, Dictionary<string, List<TargetSpecification>> targetsWhichRunAfterByTarget)
Evaluation\ProjectParser.cs (4)
261
bool belowTarget = parent.Parent is
ProjectTargetElement
;
572
private
ProjectTargetElement
ParseProjectTargetElement(XmlElementWithLocation element)
586
ProjectTargetElement
target = new ProjectTargetElement(element, _project, _project);
651
private ProjectTaskElement ParseProjectTaskElement(XmlElementWithLocation element,
ProjectTargetElement
parent)
Instance\ProjectTargetInstance.cs (2)
468
internal
ProjectTargetElement
ToProjectTargetElement(ProjectRootElement rootElement)
470
ProjectTargetElement
target = rootElement.CreateTargetElement(Name);
ObjectModelRemoting\ConstructionObjectLinks\ProjectRootElementLink.cs (1)
153
public abstract
ProjectTargetElement
CreateTargetElement(string name);
ObjectModelRemoting\ConstructionObjectLinks\ProjectTargetElementLink.cs (3)
12
/// Allow for creating a local representation to external object of type <see cref="
ProjectTargetElement
"/>
17
/// Access to remote <see cref="
ProjectTargetElement
.Name"/>.
22
/// Access to remote <see cref="
ProjectTargetElement
.Returns"/>.
ObjectModelRemoting\LinkedObjectFactory.cs (1)
206
public
ProjectTargetElement
Create(ProjectTargetElementLink link)
Microsoft.Build.Engine.OM.UnitTests (117)
Construction\ConstructionEditing_Tests.cs (57)
31
ProjectTargetElement
target = project.AddTarget("t");
56
ProjectTargetElement
target = project.CreateTargetElement("t");
77
ProjectTargetElement
target1 = project.CreateTargetElement("t");
78
ProjectTargetElement
target2 = project.CreateTargetElement("t2");
108
ProjectTargetElement
target = project1.CreateTargetElement("t");
122
ProjectTargetElement
target = project1.CreateTargetElement("t");
136
ProjectTargetElement
target1 = project1.CreateTargetElement("t");
137
ProjectTargetElement
target2 = project2.AddTarget("t2");
151
ProjectTargetElement
target1 = project1.CreateTargetElement("t");
152
ProjectTargetElement
target2 = project2.AddTarget("t2");
248
ProjectTargetElement
target = project.AddTarget("t");
262
ProjectTargetElement
target = project.AddTarget("t");
276
ProjectTargetElement
target1 = project.AddTarget("t");
277
ProjectTargetElement
target2 = project.AddTarget("t2");
291
ProjectTargetElement
target1 = project.AddTarget("t");
292
ProjectTargetElement
target2 = project.AddTarget("t2");
306
ProjectTargetElement
target = project.CreateTargetElement("t");
321
ProjectTargetElement
target = project.CreateTargetElement("t");
336
ProjectTargetElement
target = project.CreateTargetElement("t");
352
ProjectTargetElement
target = project.CreateTargetElement("t");
366
ProjectTargetElement
target = project.CreateTargetElement("t");
390
ProjectTargetElement
target = project.CreateTargetElement("t");
438
ProjectTargetElement
target = project.CreateTargetElement("t");
467
ProjectTargetElement
target = project.CreateTargetElement("t");
490
ProjectTargetElement
target = project.CreateTargetElement("t");
512
ProjectTargetElement
target1 = project.CreateTargetElement("t");
513
ProjectTargetElement
target2 = project.CreateTargetElement("t2");
543
ProjectTargetElement
target1 = project.CreateTargetElement("t");
564
ProjectTargetElement
target = project.CreateTargetElement("t");
585
ProjectTargetElement
target = project.CreateTargetElement("t");
609
ProjectTargetElement
target = project.AddTarget("t");
632
ProjectTargetElement
target = project.CreateTargetElement("t");
646
ProjectTargetElement
target = project.CreateTargetElement("t");
676
ProjectTargetElement
target = project.CreateTargetElement("t");
703
ProjectTargetElement
target = project.CreateTargetElement("t");
1173
ProjectTargetElement
target = project.AddTarget("t");
1194
ProjectTargetElement
target = project.CreateTargetElement("t");
1207
ProjectTargetElement
target = project1.CreateTargetElement("t");
1333
ProjectTargetElement
target1 = project.AddTarget("t1");
1334
ProjectTargetElement
target2 = project.AddTarget("t2");
1357
ProjectTargetElement
target1 = project.AddTarget("t1");
1358
ProjectTargetElement
target2 = project.AddTarget("t2");
1381
ProjectTargetElement
target1 = project.AddTarget("t1");
1382
ProjectTargetElement
target2 = project.AddTarget("t2");
1398
ProjectTargetElement
target1 = project.AddTarget("t1");
1412
ProjectTargetElement
target1 = project.AddTarget("t1");
1413
ProjectTargetElement
target2 = project.AddTarget("t2");
1438
ProjectTargetElement
target1 = project.AddTarget("t1");
1461
ProjectTargetElement
target1 = project.AddTarget("t1");
1483
ProjectTargetElement
target1 = project.AddTarget("t1");
1503
ProjectTargetElement
target1 = project.AddTarget("t1");
1551
ProjectTargetElement
target1 = project.AddTarget("t1");
1552
ProjectTargetElement
target2 = project.AddTarget("t2");
2708
var
element = ProjectRootElement.Create().AddTarget("t");
2719
var
element = ProjectRootElement.Create().AddTarget("t");
2730
var
element = ProjectRootElement.Create().AddTarget("t");
2741
var
element = ProjectRootElement.Create().AddTarget("t");
Construction\ElementLocationPublic_Tests.cs (3)
31
ProjectTargetElement
target = project.CreateTargetElement("t");
48
ProjectTargetElement
target = project.CreateTargetElement("t");
69
ProjectTargetElement
target = project.CreateTargetElement("t");
Construction\ProjectOnErrorElement_Tests.cs (10)
51
ProjectTargetElement
target = (
ProjectTargetElement
)Helpers.GetFirst(project.Children);
81
ProjectTargetElement
target = (
ProjectTargetElement
)Helpers.GetFirst(project.Children);
107
ProjectTargetElement
target = (
ProjectTargetElement
)Helpers.GetFirst(project.Children);
259
ProjectTargetElement
target = project.AddTarget("t");
277
ProjectTargetElement
target = project.AddTarget("t");
303
ProjectTargetElement
target = (
ProjectTargetElement
)Helpers.GetFirst(project.Children);
Construction\ProjectOutputElement_Tests.cs (4)
292
ProjectTargetElement
target = (
ProjectTargetElement
)Helpers.GetFirst(project.Children);
315
ProjectTargetElement
target = (
ProjectTargetElement
)Helpers.GetFirst(project.Children);
Construction\ProjectRootElement_Tests.cs (1)
1167
var
target = pre.AddTarget("SomeTarget");
Construction\ProjectTargetElement_Tests.cs (20)
60
ProjectTargetElement
target = (
ProjectTargetElement
)Helpers.GetFirst(project.Children);
72
ProjectTargetElement
target = GetTargetXml();
86
ProjectTargetElement
target = GetTargetXml();
107
ProjectTargetElement
target = GetTargetXml();
119
ProjectTargetElement
target = GetTargetXml();
131
ProjectTargetElement
target = GetTargetXml();
143
ProjectTargetElement
target = GetTargetXml();
153
ProjectTargetElement
target = GetTargetXml();
199
ProjectTargetElement
target = GetTargetXml();
219
ProjectTargetElement
target = project.AddTarget("t");
235
ProjectTargetElement
target = project.AddTarget("t");
251
ProjectTargetElement
target = project.AddTarget("t");
267
ProjectTargetElement
target = project.AddTarget("t");
283
ProjectTargetElement
target = project.AddTarget("t");
299
ProjectTargetElement
target = project.AddTarget("t");
316
ProjectTargetElement
target = project.AddTarget("t");
371
private static
ProjectTargetElement
GetTargetXml()
384
ProjectTargetElement
target = (
ProjectTargetElement
)Helpers.GetFirst(project.Children);
Construction\ProjectTaskElement_Tests.cs (2)
302
ProjectTargetElement
target = (
ProjectTargetElement
)Helpers.GetFirst(project.Children);
ObjectModelRemoting\Helpers\ViewValidation.construction.cs (2)
791
public static void Verify(
ProjectTargetElement
viewXml,
ProjectTargetElement
realXml, ValidationContext context = null)
ObjectModelRemoting\Helpers\ViewValidation.cs (1)
184
if (VerifyCheckType<
ProjectTargetElement
>(view, real, context, Verify))
ObjectModelRemoting\LinkedConstructionModify_Tests.cs (12)
97
xmlPair.Add2NewChildrenWithVerify<
ProjectTargetElement
>("NewTarget", (p, n) => p.AddTarget(n), (t, n) => string.Equals(t.Name, n), out var newTarget1, out var newTarget2);
121
xmlPair.CreateWithVerify<
ProjectTargetElement
>((p) => p.CreateTargetElement("target"));
148
var newTarget1 = xmlPair.AddNewChaildWithVerify<
ProjectTargetElement
>(ObjectType.View, NewTargetName, (p, n) => p.AddTarget(n), (t, n) => string.Equals(t.Name, n));
182
Assert.Empty(xmlPair.QueryChildrenWithValidation<
ProjectTargetElement
>((t) => string.Equals(t.Name, NewTargetName)));
183
newTarget1.VerifySame(xmlPair.QuerySingleChildrenWithValidation<
ProjectTargetElement
>((t) => string.Equals(t.Name, NewTargetRenamed)));
186
Assert.Empty(xmlPair.QueryChildrenWithValidation<
ProjectTargetElement
>((t) => string.Equals(t.Name, NewTargetRenamed)));
187
Assert.Empty(xmlPair.QueryChildrenWithValidation<
ProjectTargetElement
>((t) => string.Equals(t.Name, NewTargetName)));
189
newTarget1.VerifySame(xmlPair.QuerySingleChildrenWithValidation<
ProjectTargetElement
>((t) => string.Equals(t.Name, NewTargetRenamed.Ver(2))));
223
var newTarget = xmlPair.AddNewChaildWithVerify<
ProjectTargetElement
>(ObjectType.View, "TargetToTestTask", (p, n) => p.AddTarget(n), (t, n) => string.Equals(t.Name, n));
319
var newTarget = xmlPair.AddNewChaildWithVerify<
ProjectTargetElement
>(ObjectType.View, "TargetToTestTask", (p, n) => p.AddTarget(n), (t, n) => string.Equals(t.Name, n));
642
var target = xmlPair.AddNewChaildWithVerify<
ProjectTargetElement
>(ObjectType.View, "NewTarget", (p, n) => p.AddTarget(n), (t, n) => string.Equals(t.Name, n));
777
var newTarget = xmlPair.AddNewChaildWithVerify<
ProjectTargetElement
>(ObjectType.View, "TargetToTestTask", (p, n) => p.AddTarget(n), (t, n) => string.Equals(t.Name, n));
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\MockProjectRootElementLink.cs (2)
286
public override
ProjectTargetElement
CreateTargetElement(string name)
288
return (
ProjectTargetElement
)this.Proxy.CreateTargetElement(name).Import(this.Linker);
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\MockProjectTargetElementLink.cs (2)
14
public
ProjectTargetElement
TargetXml => (
ProjectTargetElement
)Source;
ObjectModelRemoting\RemoteProjectsProviderMock\ConstructionLinkMocks\ProjectElemetExportHelper.cs (1)
66
ElementInfo.New<
ProjectTargetElement
, MockProjectTargetElementLinkRemoter>(),
Microsoft.Build.Engine.UnitTests (9)
BackEnd\BuildManager_Tests.cs (1)
3642
ProjectTargetElement
buildTarget = rootProject.AddTarget("Build");
ConsoleLogger_Tests.cs (1)
146
ProjectTargetElement
target = project.Xml.AddTarget("T");
Construction\SolutionProjectGenerator_Tests.cs (1)
332
ProjectTargetElement
target = projectXml.AddTarget("Build");
Evaluation\Evaluator_Tests.cs (6)
1374
ProjectTargetElement
target0 = main.AddTarget("t0");
1379
ProjectTargetElement
target1 = import1.AddTarget("t1");
1384
ProjectTargetElement
target2 = import2.AddTarget("t2");
1389
ProjectTargetElement
target3 = import3.AddTarget("t3");
5194
private void AddPropertyDumpTasks(string prefix,
ProjectTargetElement
target)
5210
ProjectTargetElement
target = import.AddTarget(targetName);