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