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)
339
public ICollection<
ProjectTargetElement
> Targets => GetChildrenOfType<
ProjectTargetElement
>();
1214
public
ProjectTargetElement
AddTarget(string name)
1216
ProjectTargetElement
target = CreateTargetElement(name);
1411
public
ProjectTargetElement
CreateTargetElement(string name)
1413
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,
985
ProjectTargetElement
target = traversalProject.CreateTargetElement(targetName);
Evaluation\Evaluator.cs (16)
102
private readonly List<
ProjectTargetElement
> _targetElements;
248
_targetElements = new List<
ProjectTargetElement
>();
547
private static ProjectTargetInstance ReadNewTargetElement(
ProjectTargetElement
targetElement, bool parentProjectSupportsReturnsAttribute, EvaluationProfiler evaluationProfiler)
756
LinkedList<
ProjectTargetElement
> activeTargetsByEvaluationOrder = new LinkedList<
ProjectTargetElement
>();
757
Dictionary<string, LinkedListNode<
ProjectTargetElement
>> activeTargets = new Dictionary<string, LinkedListNode<
ProjectTargetElement
>>(StringComparer.OrdinalIgnoreCase);
766
var
element = _targetElements[i];
773
foreach (
ProjectTargetElement
target in activeTargetsByEvaluationOrder)
904
case
ProjectTargetElement
target:
1030
private void ReadTargetElement(
ProjectTargetElement
targetElement, LinkedList<
ProjectTargetElement
> activeTargetsByEvaluationOrder, Dictionary<string, LinkedListNode<
ProjectTargetElement
>> activeTargets)
1042
if (activeTargets.TryGetValue(targetName, out LinkedListNode<
ProjectTargetElement
> node))
1054
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)
32
ProjectTargetElement
target = project.AddTarget("t");
57
ProjectTargetElement
target = project.CreateTargetElement("t");
78
ProjectTargetElement
target1 = project.CreateTargetElement("t");
79
ProjectTargetElement
target2 = project.CreateTargetElement("t2");
109
ProjectTargetElement
target = project1.CreateTargetElement("t");
123
ProjectTargetElement
target = project1.CreateTargetElement("t");
137
ProjectTargetElement
target1 = project1.CreateTargetElement("t");
138
ProjectTargetElement
target2 = project2.AddTarget("t2");
152
ProjectTargetElement
target1 = project1.CreateTargetElement("t");
153
ProjectTargetElement
target2 = project2.AddTarget("t2");
249
ProjectTargetElement
target = project.AddTarget("t");
263
ProjectTargetElement
target = project.AddTarget("t");
277
ProjectTargetElement
target1 = project.AddTarget("t");
278
ProjectTargetElement
target2 = project.AddTarget("t2");
292
ProjectTargetElement
target1 = project.AddTarget("t");
293
ProjectTargetElement
target2 = project.AddTarget("t2");
307
ProjectTargetElement
target = project.CreateTargetElement("t");
322
ProjectTargetElement
target = project.CreateTargetElement("t");
337
ProjectTargetElement
target = project.CreateTargetElement("t");
353
ProjectTargetElement
target = project.CreateTargetElement("t");
367
ProjectTargetElement
target = project.CreateTargetElement("t");
391
ProjectTargetElement
target = project.CreateTargetElement("t");
439
ProjectTargetElement
target = project.CreateTargetElement("t");
468
ProjectTargetElement
target = project.CreateTargetElement("t");
491
ProjectTargetElement
target = project.CreateTargetElement("t");
513
ProjectTargetElement
target1 = project.CreateTargetElement("t");
514
ProjectTargetElement
target2 = project.CreateTargetElement("t2");
544
ProjectTargetElement
target1 = project.CreateTargetElement("t");
565
ProjectTargetElement
target = project.CreateTargetElement("t");
586
ProjectTargetElement
target = project.CreateTargetElement("t");
610
ProjectTargetElement
target = project.AddTarget("t");
633
ProjectTargetElement
target = project.CreateTargetElement("t");
647
ProjectTargetElement
target = project.CreateTargetElement("t");
677
ProjectTargetElement
target = project.CreateTargetElement("t");
704
ProjectTargetElement
target = project.CreateTargetElement("t");
1174
ProjectTargetElement
target = project.AddTarget("t");
1195
ProjectTargetElement
target = project.CreateTargetElement("t");
1208
ProjectTargetElement
target = project1.CreateTargetElement("t");
1334
ProjectTargetElement
target1 = project.AddTarget("t1");
1335
ProjectTargetElement
target2 = project.AddTarget("t2");
1358
ProjectTargetElement
target1 = project.AddTarget("t1");
1359
ProjectTargetElement
target2 = project.AddTarget("t2");
1382
ProjectTargetElement
target1 = project.AddTarget("t1");
1383
ProjectTargetElement
target2 = project.AddTarget("t2");
1399
ProjectTargetElement
target1 = project.AddTarget("t1");
1413
ProjectTargetElement
target1 = project.AddTarget("t1");
1414
ProjectTargetElement
target2 = project.AddTarget("t2");
1439
ProjectTargetElement
target1 = project.AddTarget("t1");
1462
ProjectTargetElement
target1 = project.AddTarget("t1");
1484
ProjectTargetElement
target1 = project.AddTarget("t1");
1504
ProjectTargetElement
target1 = project.AddTarget("t1");
1552
ProjectTargetElement
target1 = project.AddTarget("t1");
1553
ProjectTargetElement
target2 = project.AddTarget("t2");
2709
var
element = ProjectRootElement.Create().AddTarget("t");
2720
var
element = ProjectRootElement.Create().AddTarget("t");
2731
var
element = ProjectRootElement.Create().AddTarget("t");
2742
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)
1171
var
target = pre.AddTarget("SomeTarget");
Construction\ProjectTargetElement_Tests.cs (20)
61
ProjectTargetElement
target = (
ProjectTargetElement
)Helpers.GetFirst(project.Children);
73
ProjectTargetElement
target = GetTargetXml();
87
ProjectTargetElement
target = GetTargetXml();
108
ProjectTargetElement
target = GetTargetXml();
120
ProjectTargetElement
target = GetTargetXml();
132
ProjectTargetElement
target = GetTargetXml();
144
ProjectTargetElement
target = GetTargetXml();
154
ProjectTargetElement
target = GetTargetXml();
200
ProjectTargetElement
target = GetTargetXml();
220
ProjectTargetElement
target = project.AddTarget("t");
236
ProjectTargetElement
target = project.AddTarget("t");
252
ProjectTargetElement
target = project.AddTarget("t");
268
ProjectTargetElement
target = project.AddTarget("t");
284
ProjectTargetElement
target = project.AddTarget("t");
300
ProjectTargetElement
target = project.AddTarget("t");
317
ProjectTargetElement
target = project.AddTarget("t");
372
private static
ProjectTargetElement
GetTargetXml()
385
ProjectTargetElement
target = (
ProjectTargetElement
)Helpers.GetFirst(project.Children);
Construction\ProjectTaskElement_Tests.cs (2)
304
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)
3643
ProjectTargetElement
buildTarget = rootProject.AddTarget("Build");
ConsoleLogger_Tests.cs (1)
148
ProjectTargetElement
target = project.Xml.AddTarget("T");
Construction\SolutionProjectGenerator_Tests.cs (1)
303
ProjectTargetElement
target = projectXml.AddTarget("Build");
Evaluation\Evaluator_Tests.cs (6)
1339
ProjectTargetElement
target0 = main.AddTarget("t0");
1344
ProjectTargetElement
target1 = import1.AddTarget("t1");
1349
ProjectTargetElement
target2 = import2.AddTarget("t2");
1354
ProjectTargetElement
target3 = import3.AddTarget("t3");
5159
private void AddPropertyDumpTasks(string prefix,
ProjectTargetElement
target)
5175
ProjectTargetElement
target = import.AddTarget(targetName);