7 instantiations of ProjectGraphNode
Microsoft.Build (1)
Graph\GraphBuilder.cs (1)
540
var graphNode = new
ProjectGraphNode
(projectInstance);
Microsoft.Build.Engine.UnitTests (6)
Graph\ProjectGraph_Tests.cs (6)
126
Assert.Throws<InternalErrorException>(() => new
ProjectGraphNode
(null));
135
var node = new
ProjectGraphNode
(projectInstance);
136
var reference1 = new
ProjectGraphNode
(projectInstance);
139
var reference2 = new
ProjectGraphNode
(projectInstance);
182
var node = new
ProjectGraphNode
(projectInstance);
183
var reference1 = new
ProjectGraphNode
(projectInstance);
291 references to ProjectGraphNode
Microsoft.Build (117)
BackEnd\BuildManager\BuildManager.cs (14)
1936
Dictionary<
ProjectGraphNode
, BuildResult>? resultsPerNode = null;
1942
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetsPerNode = projectGraph.GetTargetLists(submission.BuildRequestData.TargetNames);
1949
foreach (
ProjectGraphNode
entryPointNode in projectGraph.EntryPointNodes)
1969
new ReadOnlyDictionary<
ProjectGraphNode
, BuildResult>(resultsPerNode ?? new Dictionary<
ProjectGraphNode
, BuildResult>())));
1971
static void DumpGraph(ProjectGraph graph, IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>>? targetList = null)
1984
private Dictionary<
ProjectGraphNode
, BuildResult> BuildGraph(
1986
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetsPerNode,
1997
var blockedNodes = new HashSet<
ProjectGraphNode
>(projectGraph.ProjectNodes);
1998
var finishedNodes = new HashSet<
ProjectGraphNode
>(projectGraph.ProjectNodes.Count);
1999
var buildingNodes = new Dictionary<BuildSubmissionBase,
ProjectGraphNode
>();
2000
var resultsPerNode = new Dictionary<
ProjectGraphNode
, BuildResult>(projectGraph.ProjectNodes.Count);
2019
foreach (
var
node in unblockedNodes)
2056
ProjectGraphNode
finishedNode = buildingNodes[finishedBuildSubmission];
Graph\GraphBuilder.cs (46)
33
public IReadOnlyCollection<
ProjectGraphNode
> ProjectNodes { get; private set; }
35
public IReadOnlyCollection<
ProjectGraphNode
> RootNodes { get; private set; }
37
public IReadOnlyCollection<
ProjectGraphNode
> EntryPointNodes { get; private set; }
103
private static IReadOnlyCollection<
ProjectGraphNode
> GetGraphRoots(IReadOnlyCollection<
ProjectGraphNode
> entryPointNodes)
105
var graphRoots = new List<
ProjectGraphNode
>(entryPointNodes.Count);
107
foreach (
var
entryPointNode in entryPointNodes)
136
Dictionary<
ProjectGraphNode
, HashSet<
ProjectGraphNode
>> transitiveReferenceCache = new(allParsedProjects.Count);
140
var
currentNode = parsedProject.Value.GraphNode;
155
foreach (
var
transitiveProjectReference in GetTransitiveProjectReferencesExcludingSelf(allParsedProjects[referenceInfo.ReferenceConfiguration]))
171
HashSet<
ProjectGraphNode
> GetTransitiveProjectReferencesExcludingSelf(ParsedProject parsedProject)
173
if (transitiveReferenceCache.TryGetValue(parsedProject.GraphNode, out HashSet<
ProjectGraphNode
> transitiveReferences))
190
foreach (
ProjectGraphNode
transitiveReference in GetTransitiveProjectReferencesExcludingSelf(reference))
202
var projectsByPath = new Dictionary<string, List<
ProjectGraphNode
>>();
214
projectsByPath[projectPath] = new List<
ProjectGraphNode
> { project.Value.GraphNode };
227
ErrorUtilities.VerifyThrow(projectsByPath.TryGetValue(referencedProjectPath, out List<
ProjectGraphNode
> projectToReturn), "nodes should include solution projects");
231
foreach (
var
referencingNode in referencingNodes)
233
foreach (
var
referencedNode in referencedNodes)
440
IReadOnlyCollection<
ProjectGraphNode
> entryPointNodes,
444
var nodeStates = new Dictionary<
ProjectGraphNode
, NodeVisitationState>();
446
foreach (
var
entryPointNode in entryPointNodes)
463
ProjectGraphNode
node,
464
IDictionary<
ProjectGraphNode
, NodeVisitationState> nodeState)
468
foreach (
var
referenceNode in node.ProjectReferences)
540
var
graphNode = new ProjectGraphNode(projectInstance);
573
private List<ProjectInterpretation.ReferenceInfo> ParseReferences(
ProjectGraphNode
parsedProject)
647
private ConcurrentDictionary<(
ProjectGraphNode
,
ProjectGraphNode
), ProjectItemInstance> ReferenceItems =
648
new ConcurrentDictionary<(
ProjectGraphNode
,
ProjectGraphNode
), ProjectItemInstance>();
652
public ProjectItemInstance this[(
ProjectGraphNode
node,
ProjectGraphNode
reference) key]
661
public void AddOrUpdateEdge((
ProjectGraphNode
node,
ProjectGraphNode
reference) key, ProjectItemInstance edge)
665
addValueFactory: static ((
ProjectGraphNode
node,
ProjectGraphNode
reference) key, ProjectItemInstance referenceItem) => referenceItem,
666
updateValueFactory: static ((
ProjectGraphNode
node,
ProjectGraphNode
reference) key, ProjectItemInstance existingItem, ProjectItemInstance newItem) =>
684
static string GetEffectiveTargets(
ProjectGraphNode
reference, string targetsMetadata)
697
public void RemoveEdge((
ProjectGraphNode
node,
ProjectGraphNode
reference) key)
702
internal bool HasEdge((
ProjectGraphNode
node,
ProjectGraphNode
reference) key) => ReferenceItems.ContainsKey(key);
724
public
ProjectGraphNode
GraphNode { get; }
727
public ParsedProject(ConfigurationMetadata configurationMetadata,
ProjectGraphNode
graphNode, List<ProjectInterpretation.ReferenceInfo> referenceInfos)
Graph\GraphBuildRequestData.cs (2)
199
foreach (
ProjectGraphNode
entryPoint in ProjectGraph.EntryPointNodes)
218
ProjectGraphNode
? node = ProjectGraph?.EntryPointNodes.FirstOrDefault();
Graph\GraphBuildResult.cs (5)
19
internal GraphBuildResult(int submissionId, IReadOnlyDictionary<
ProjectGraphNode
, BuildResult> resultsByNode)
34
ResultsByNode = ImmutableDictionary<
ProjectGraphNode
, BuildResult>.Empty;
64
foreach (KeyValuePair<
ProjectGraphNode
, BuildResult> result in ResultsByNode)
79
public IReadOnlyDictionary<
ProjectGraphNode
, BuildResult> ResultsByNode { get; }
87
public BuildResult this[
ProjectGraphNode
node] => ResultsByNode[node];
Graph\ProjectGraph.cs (35)
60
private readonly Lazy<IReadOnlyCollection<
ProjectGraphNode
>> _projectNodesTopologicallySorted;
92
public IReadOnlyCollection<
ProjectGraphNode
> EntryPointNodes { get; }
97
public IReadOnlyCollection<
ProjectGraphNode
> ProjectNodes { get; }
103
public IReadOnlyCollection<
ProjectGraphNode
> ProjectNodesTopologicallySorted => _projectNodesTopologicallySorted.Value;
105
public IReadOnlyCollection<
ProjectGraphNode
> GraphRoots { get; }
449
_projectNodesTopologicallySorted = new Lazy<IReadOnlyCollection<
ProjectGraphNode
>>(() => TopologicalSort(GraphRoots, ProjectNodes));
491
internal string ToDot(IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetsPerNode = null)
498
Func<
ProjectGraphNode
, string> nodeIdProvider,
499
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetsPerNode = null)
503
var nodeIds = new ConcurrentDictionary<
ProjectGraphNode
, string>();
513
foreach (
var
node in ProjectNodes)
528
foreach (
var
reference in node.ProjectReferences)
540
string GetNodeId(
ProjectGraphNode
node)
545
string GetTargetListString(
ProjectGraphNode
node)
559
private static IReadOnlyCollection<
ProjectGraphNode
> TopologicalSort(
560
IReadOnlyCollection<
ProjectGraphNode
> graphRoots,
561
IReadOnlyCollection<
ProjectGraphNode
> graphNodes)
563
var toposort = new List<
ProjectGraphNode
>(graphNodes.Count);
564
var partialRoots = new Queue<
ProjectGraphNode
>(graphNodes.Count);
567
foreach (
var
root in graphRoots)
574
var
partialRoot = partialRoots.Dequeue();
578
foreach (
var
reference in partialRoot.ProjectReferences)
609
public IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> GetTargetLists(ICollection<string> entryProjectTargets)
622
foreach (
ProjectGraphNode
entryPointNode in EntryPointNodes)
637
foreach (
ProjectGraphNode
entryPointNode in EntryPointNodes)
665
ProjectGraphNode
node = GetNodeForProject(project);
683
ProjectGraphNode
node = GetNodeForProject(project);
691
ProjectGraphNode
GetNodeForProject(ProjectInSolution project) => EntryPointNodes.First(node => string.Equals(node.ProjectInstance.FullPath, project.AbsolutePath));
697
foreach (
ProjectGraphNode
entryPointNode in EntryPointNodes)
711
var
node = buildRequest.Node;
726
foreach (
var
referenceNode in node.ProjectReferences)
752
var entriesToUpdate = new List<KeyValuePair<
ProjectGraphNode
, ImmutableList<string>>>();
774
entriesToUpdate.Add(new KeyValuePair<
ProjectGraphNode
, ImmutableList<string>>(pair.Key, targetList));
866
public ProjectGraphBuildRequest(
ProjectGraphNode
node, ImmutableList<string> targets)
872
public
ProjectGraphNode
Node { get; }
Graph\ProjectGraphNode.cs (9)
22
private readonly HashSet<
ProjectGraphNode
> _projectReferences = new HashSet<
ProjectGraphNode
>();
23
private readonly HashSet<
ProjectGraphNode
> _referencingProjects = new HashSet<
ProjectGraphNode
>();
39
public IReadOnlyCollection<
ProjectGraphNode
> ProjectReferences => _projectReferences;
44
public IReadOnlyCollection<
ProjectGraphNode
> ReferencingProjects => _referencingProjects;
59
internal void AddProjectReference(
ProjectGraphNode
reference, ProjectItemInstance projectReferenceItem, GraphBuilder.GraphEdges edges)
67
internal void RemoveReference(
ProjectGraphNode
reference, GraphBuilder.GraphEdges edges)
77
foreach (
var
reference in _projectReferences)
Graph\ProjectInterpretation.cs (6)
77
public IEnumerable<ReferenceInfo> GetReferences(
ProjectGraphNode
projectGraphNode, ProjectCollection projectCollection, ProjectGraph.ProjectInstanceFactoryFunc projectInstanceFactory)
250
ProjectGraphNode
outerBuild = node.Value.GraphNode;
254
foreach (
ProjectGraphNode
innerBuild in outerBuild.ProjectReferences)
256
foreach (
ProjectGraphNode
outerBuildReferencingProject in outerBuild.ReferencingProjects)
525
public ImmutableList<string> GetApplicableTargetsForReference(
ProjectGraphNode
projectGraphNode)
546
public bool RequiresTransitiveProjectReferences(
ProjectGraphNode
projectGraphNode)
Microsoft.Build.Engine.UnitTests (174)
BackEnd\BuildManager_Tests.cs (4)
4211
var
node1 = graph.ProjectNodes.First(node => node.ProjectInstance.FullPath.Equals(project1, StringComparison.OrdinalIgnoreCase));
4215
var
node2 = graph.ProjectNodes.First(node => node.ProjectInstance.FullPath.Equals(project2, StringComparison.OrdinalIgnoreCase));
4296
var
node1 = graph.ProjectNodes.First(node => node.ProjectInstance.FullPath.Equals(project1, StringComparison.OrdinalIgnoreCase));
4300
var
node2 = graph.ProjectNodes.First(node => node.ProjectInstance.FullPath.Equals(project2, StringComparison.OrdinalIgnoreCase));
Graph\GraphLoadedFromSolution_tests.cs (7)
625
var
node1 = GetFirstNodeWithProjectNumber(graph, 1);
630
var
outerBuild3 = GetOuterBuild(graph, 3);
639
IEnumerable<ProjectItemInstance> GetOutgoingEdgeItemsFromNode(
ProjectGraphNode
node, IReadOnlyDictionary<(ConfigurationMetadata, ConfigurationMetadata), ProjectItemInstance> edgeInfos)
644
IEnumerable<ProjectItemInstance> GetIncomingEdgeItemsToNode(
ProjectGraphNode
node, IReadOnlyDictionary<(ConfigurationMetadata, ConfigurationMetadata), ProjectItemInstance> edgeInfos)
708
foreach (
var
node in graphFromSolution.ProjectNodes)
716
private static string GetConfiguration(
ProjectGraphNode
node)
721
private static string GetPlatform(
ProjectGraphNode
node)
Graph\GraphTestingUtilities.cs (25)
41
ProjectGraphNode
outerBuild,
53
foreach (
ProjectGraphNode
innerBuild in outerBuild.ProjectReferences)
65
foreach (
ProjectGraphNode
outerBuildReferencer in outerBuild.ReferencingProjects)
67
ProjectGraphNode
[] innerBuilds = outerBuildReferencer.ProjectReferences
73
foreach (
ProjectGraphNode
innerBuild in innerBuilds)
90
public static void AssertNonMultitargetingNode(
ProjectGraphNode
node, Dictionary<string, string> additionalGlobalProperties = null)
99
public static void AssertOuterBuildEvaluation(
ProjectGraphNode
outerBuild, Dictionary<string, string> additionalGlobalProperties)
110
ProjectGraphNode
innerBuild,
131
internal static
ProjectGraphNode
GetFirstNodeWithProjectNumber(ProjectGraph graph, int projectNum)
136
internal static IEnumerable<
ProjectGraphNode
> GetNodesWithProjectNumber(ProjectGraph graph, int projectNum)
141
internal static
ProjectGraphNode
GetOuterBuild(ProjectGraph graph, int projectNumber)
146
internal static IReadOnlyCollection<
ProjectGraphNode
> GetInnerBuilds(ProjectGraph graph, int projectNumber)
148
var
outerBuild = GetOuterBuild(graph, projectNumber);
152
return ImmutableArray<
ProjectGraphNode
>.Empty;
166
internal static string GetProjectFileName(
ProjectGraphNode
node)
178
internal static int GetProjectNumber(
ProjectGraphNode
node)
190
internal static string GetProjectPath(
ProjectGraphNode
node)
214
internal static IEnumerable<
ProjectGraphNode
> ComputeClosure(
ProjectGraphNode
node)
218
IEnumerable<
ProjectGraphNode
> ComputeClosureRecursive(
ProjectGraphNode
projectGraphNode)
220
foreach (
var
reference in projectGraphNode.ProjectReferences)
224
foreach (
var
closureReference in ComputeClosureRecursive(reference))
236
var
node = GetFirstNodeWithProjectNumber(graph, kvp.Key);
241
internal static void AssertReferencesIgnoringOrder(this
ProjectGraphNode
node, int[] expectedReferences)
Graph\IsolateProjects_Tests.cs (3)
16
using ExpectedNodeBuildOutput = System.Collections.Generic.Dictionary<Microsoft.Build.Graph.
ProjectGraphNode
, string[]>;
17
using OutputCacheDictionary = System.Collections.Generic.Dictionary<Microsoft.Build.Graph.
ProjectGraphNode
, string>;
328
ProjectGraphNode
[] topoSortedProjectGraphNodes = projectGraph.ProjectNodesTopologicallySorted.ToArray();
Graph\ProjectGraph_Tests.cs (108)
135
var
node = new ProjectGraphNode(projectInstance);
136
var
reference1 = new ProjectGraphNode(projectInstance);
139
var
reference2 = new ProjectGraphNode(projectInstance);
182
var
node = new ProjectGraphNode(projectInstance);
183
var
reference1 = new ProjectGraphNode(projectInstance);
262
ProjectGraphNode
node1 = GetFirstNodeWithProjectNumber(graph, 1);
263
ProjectGraphNode
node2 = GetFirstNodeWithProjectNumber(graph, 2);
264
ProjectGraphNode
node3 = GetFirstNodeWithProjectNumber(graph, 3);
265
ProjectGraphNode
node4 = GetFirstNodeWithProjectNumber(graph, 4);
266
ProjectGraphNode
node5 = GetFirstNodeWithProjectNumber(graph, 5);
267
ProjectGraphNode
node6 = GetFirstNodeWithProjectNumber(graph, 6);
268
ProjectGraphNode
node7 = GetFirstNodeWithProjectNumber(graph, 7);
369
var
root1 = GetFirstNodeWithProjectNumber(graph, 1);
376
var
root2 = GetFirstNodeWithProjectNumber(graph, 2);
466
var
node4A = GetFirstNodeWithProjectNumber(graph, 2).ProjectReferences.First();
467
var
node4B = GetFirstNodeWithProjectNumber(graph, 3).ProjectReferences.First();
581
var
node1 = GetFirstNodeWithProjectNumber(projectGraph, 1);
582
var
node2 = GetFirstNodeWithProjectNumber(projectGraph, 2);
583
var
node3 = GetFirstNodeWithProjectNumber(projectGraph, 3);
606
var
entryPointNode1 = projectGraph.EntryPointNodes.First();
607
var
entryPointNode2 = projectGraph.EntryPointNodes.Last();
645
var
entryPointNode1 = projectGraph.EntryPointNodes.First();
646
var
entryPointNode2 = projectGraph.EntryPointNodes.Last();
868
ProjectGraphNode
project1Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project1Path);
874
ProjectGraphNode
project2Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project2Path);
880
ProjectGraphNode
project3Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project3Path);
887
ProjectGraphNode
project4Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project4Path);
893
ProjectGraphNode
project5Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project5Path);
899
ProjectGraphNode
project6Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project6Path);
907
ProjectGraphNode
project8Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project8Path);
927
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new[] { "A" });
955
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new[] { "A" });
986
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new[] { "A" });
1008
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(null);
1026
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new[] { "Foo" });
1049
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(null);
1072
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new[] { "A" });
1115
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string> { "A" });
1156
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string> { "A" });
1190
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string> { "A" });
1193
var
root = GetFirstNodeWithProjectNumber(projectGraph, 1);
1195
var
outerBuild = GetOuterBuild(projectGraph, 2);
1201
foreach (
var
innerBuild in innerBuilds)
1255
ProjectGraphNode
rootOuterBuild = GetOuterBuild(graph, 1);
1256
ProjectGraphNode
nonRootOuterBuild = GetOuterBuild(graph, 3);
1261
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = graph.GetTargetLists(new[] { "A" });
1265
foreach (
ProjectGraphNode
innerBuild in GetInnerBuilds(graph, 1))
1274
foreach (
ProjectGraphNode
innerBuild in GetInnerBuilds(graph, 3))
1362
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string> { "A" });
1375
void AssertMultitargetingNode(int projectNumber, ProjectGraph projectGraph, IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists, string[] outerBuildTargets, string[] nonOuterBuildTargets)
1379
foreach (
var
innerBuild in GetInnerBuilds(projectGraph, projectNumber))
1397
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(null);
1420
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(null);
1450
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(null);
1507
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(entryProjectTargets: null);
1552
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = graph.GetTargetLists(entryProjectTargets: new[] { "Build" });
1559
expectedNodeBuildOutput: new Dictionary<
ProjectGraphNode
, string[]>(),
1560
outputCaches: new Dictionary<
ProjectGraphNode
, string>(),
1602
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = graph.GetTargetLists(entryProjectTargets: new[] { "Build" });
1609
expectedNodeBuildOutput: new Dictionary<
ProjectGraphNode
, string[]>(),
1610
outputCaches: new Dictionary<
ProjectGraphNode
, string>(),
1633
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = graph.GetTargetLists(null);
1847
Func<
ProjectGraphNode
, string> nodeIdProvider = GetProjectFileName;
1853
foreach (
var
node in graph.ProjectNodes)
1865
foreach (
var
reference in node.ProjectReferences)
1890
var
outerBuild = graph.GraphRoots.First();
1917
var
outerBuild = GetOuterBuild(graph, 2);
1951
var
outerBuild = GetOuterBuild(graph, 2);
1955
var
outerBuildReferencingNode = GetFirstNodeWithProjectNumber(graph, 1);
1959
foreach (
var
innerBuild in GetInnerBuilds(graph, 2))
1984
var
rootOuterBuild = GetOuterBuild(graph, 1);
1985
var
nonRootOuterBuild = GetOuterBuild(graph, 2);
2005
var
nonMultitargetingNode = GetFirstNodeWithProjectNumber(graph, 2);
2033
var
nonMultitargetingNode = GetFirstNodeWithProjectNumber(graph, 2);
2052
var
nonMultitargetingNode = GetFirstNodeWithProjectNumber(graph, 2);
2105
var
innerBuildWithCommonReferences = GetNodesWithProjectNumber(graph, 1).First(n => n.ProjectInstance.GlobalProperties.TryGetValue(InnerBuildPropertyName, out string p) && p == "a");
2111
var
innerBuildWithAdditionalReferences = GetNodesWithProjectNumber(graph, 1).First(n => n.ProjectInstance.GlobalProperties.TryGetValue(InnerBuildPropertyName, out string p) && p == "b");
2138
var
outerBuild = graph.GraphRoots.First(i => i.ProjectType == ProjectInterpretation.ProjectType.OuterBuild);
2143
var
referencedInnerBuild = GetNodesWithProjectNumber(graph, 1).First(n => n.ProjectInstance.GetPropertyValue(InnerBuildPropertyName) == "a");
2145
var
two = GetFirstNodeWithProjectNumber(graph, 2);
2172
var
rootNode = graph.GraphRoots.First();
2176
var
innerBuildNode = rootNode.ProjectReferences.First();
2216
var
outerBuild1 = GetOuterBuild(graph, 1);
2220
var
innerBuild1WithReferenceToInnerBuild2 = outerBuild1.ProjectReferences.FirstOrDefault(n => n.ProjectType == ProjectInterpretation.ProjectType.InnerBuild && n.ProjectInstance.GlobalProperties[InnerBuildPropertyName] == "a");
2223
var
outerBuild2 = GetOuterBuild(graph, 2);
2226
var
innerBuild2 = GetInnerBuilds(graph, 2).FirstOrDefault();
2334
foreach (
var
node in projectGraph.ProjectNodes)
2364
foreach (
var
node in graph.ProjectNodes)
2540
foreach (
var
innerBuild in innerBuilds1)
2552
foreach (
var
innerBuild in innerBuilds4)
2619
var
outerBuild1 = GetOuterBuild(graph, 1);
2627
foreach (
var
inner1 in innerBuildsFor1)
2633
var
outerBuild2 = GetOuterBuild(graph, 2);
2640
foreach (
var
inner2 in innerBuildsFor2)
2645
var
outerBuild3 = GetOuterBuild(graph, 3);
2654
foreach (
var
inner3 in innerBuildsFor3)
2696
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = graph.GetTargetLists(Array.Empty<string>());
2698
ProjectGraphNode
project1 = GetFirstNodeWithProjectNumber(graph, 1);
2699
ProjectGraphNode
project2 = GetFirstNodeWithProjectNumber(graph, 2);
2738
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = graph.GetTargetLists(Array.Empty<string>());
2740
ProjectGraphNode
project1 = GetFirstNodeWithProjectNumber(graph, 1);
2741
ProjectGraphNode
project2 = GetFirstNodeWithProjectNumber(graph, 2);
2797
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = graph.GetTargetLists(Array.Empty<string>());
2800
foreach (
ProjectGraphNode
inner in GetInnerBuilds(graph, 1))
2806
foreach (
ProjectGraphNode
inner in GetInnerBuilds(graph, 2))
2874
ProjectGraphNode
project1Node = GetFirstNodeWithProjectNumber(projectGraph, 1);
2875
ProjectGraphNode
project2Node = GetFirstNodeWithProjectNumber(projectGraph, 2);
2877
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(entryTargets);
Graph\ResultCacheBasedBuilds_Tests.cs (10)
21
using ExpectedNodeBuildOutput = System.Collections.Generic.Dictionary<Microsoft.Build.Graph.
ProjectGraphNode
, string[]>;
22
using OutputCacheDictionary = System.Collections.Generic.Dictionary<Microsoft.Build.Graph.
ProjectGraphNode
, string>;
307
foreach (
var
node in topoSortedNodes)
350
var
rootNode = topoSortedNodes.First(n => Path.GetFileNameWithoutExtension(n.ProjectInstance.FullPath) == "1");
425
IReadOnlyCollection<
ProjectGraphNode
> topoSortedNodes,
431
Func<
ProjectGraphNode
, ExpectedNodeBuildOutput, string[]> expectedOutputProducer = null,
432
IReadOnlyDictionary<
ProjectGraphNode
, ImmutableList<string>> targetListsPerNode = null,
445
foreach (
var
node in topoSortedNodes)
492
string[] ExpectedBuildOutputForNode(
ProjectGraphNode
node)
510
private static string ProjectNumber(
ProjectGraphNode
node) => Path.GetFileNameWithoutExtension(node.ProjectInstance.FullPath);
ProjectCache\ProjectCacheTests.cs (16)
145
public CacheResult GetExpectedCacheResultForNode(
ProjectGraphNode
node)
322
public CacheResult GetCacheResultForNode(
ProjectGraphNode
node)
495
var nodesToBuildResults = new Dictionary<
ProjectGraphNode
, BuildResult>();
500
foreach (
var
node in graph.ProjectNodesTopologicallySorted)
518
(MockLogger logger, ProjectGraph graph, Dictionary<
ProjectGraphNode
, BuildResult> nodesToBuildResults) = BuildGraphVsScenario(testData, buildParameters);
542
private (MockLogger logger, ProjectGraph projectGraph, Dictionary<
ProjectGraphNode
, BuildResult> nodesToBuildResults) BuildGraphVsScenario(
547
var nodesToBuildResults = new Dictionary<
ProjectGraphNode
, BuildResult>();
582
foreach (
var
node in graph.ProjectNodesTopologicallySorted)
604
foreach (
var
node in graph.ProjectNodes)
628
private static string CreateSolutionConfigurationProperty(IReadOnlyCollection<
ProjectGraphNode
> projectNodes)
634
foreach (
var
node in projectNodes)
684
var
rootNode = graph.GraphRoots.First();
776
IReadOnlyDictionary<
ProjectGraphNode
, BuildResult> projectPathToBuildResults,
792
foreach (
var
node in graph.ProjectNodes)
832
private static int GetProjectNumber(
ProjectGraphNode
node) => GetProjectNumber(node.ProjectInstance.FullPath);
1480
foreach (
var
node in graph.ProjectNodes.Where(n => referenceNumbers.Contains(GetProjectNumber(n))))
SolutionFileBuilder.cs (1)
95
n => GraphTestingUtilities.GetProjectNumber((
ProjectGraphNode
)n).ToString(),