7 instantiations of ProjectGraphNode
Microsoft.Build (1)
Graph\GraphBuilder.cs (1)
541var graphNode = new ProjectGraphNode(projectInstance);
Microsoft.Build.Engine.UnitTests (6)
Graph\ProjectGraph_Tests.cs (6)
127Assert.Throws<InternalErrorException>(() => new ProjectGraphNode(null)); 136var node = new ProjectGraphNode(projectInstance); 137var reference1 = new ProjectGraphNode(projectInstance); 140var reference2 = new ProjectGraphNode(projectInstance); 183var node = new ProjectGraphNode(projectInstance); 184var reference1 = new ProjectGraphNode(projectInstance);
292 references to ProjectGraphNode
Microsoft.Build (118)
BackEnd\BuildManager\BuildManager.cs (14)
2124Dictionary<ProjectGraphNode, BuildResult>? resultsPerNode = null; 2130IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetsPerNode = projectGraph.GetTargetLists(submission.BuildRequestData.TargetNames); 2137foreach (ProjectGraphNode entryPointNode in projectGraph.EntryPointNodes) 2157new ReadOnlyDictionary<ProjectGraphNode, BuildResult>(resultsPerNode ?? new Dictionary<ProjectGraphNode, BuildResult>()))); 2159static void DumpGraph(ProjectGraph graph, IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>>? targetList = null) 2172private Dictionary<ProjectGraphNode, BuildResult> BuildGraph( 2174IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetsPerNode, 2185var blockedNodes = new HashSet<ProjectGraphNode>(projectGraph.ProjectNodes); 2186var finishedNodes = new HashSet<ProjectGraphNode>(projectGraph.ProjectNodes.Count); 2187var buildingNodes = new Dictionary<BuildSubmissionBase, ProjectGraphNode>(); 2188var resultsPerNode = new Dictionary<ProjectGraphNode, BuildResult>(projectGraph.ProjectNodes.Count); 2207foreach (var node in unblockedNodes) 2244ProjectGraphNode finishedNode = buildingNodes[finishedBuildSubmission];
Graph\GraphBuilder.cs (47)
34public IReadOnlyCollection<ProjectGraphNode> ProjectNodes { get; private set; } 36public IReadOnlyCollection<ProjectGraphNode> RootNodes { get; private set; } 38public IReadOnlyCollection<ProjectGraphNode> EntryPointNodes { get; private set; } 104private static IReadOnlyCollection<ProjectGraphNode> GetGraphRoots(IReadOnlyCollection<ProjectGraphNode> entryPointNodes) 106var graphRoots = new List<ProjectGraphNode>(entryPointNodes.Count); 108foreach (var entryPointNode in entryPointNodes) 137Dictionary<ProjectGraphNode, HashSet<ProjectGraphNode>> transitiveReferenceCache = new(allParsedProjects.Count); 141var currentNode = parsedProject.Value.GraphNode; 156foreach (var transitiveProjectReference in GetTransitiveProjectReferencesExcludingSelf(allParsedProjects[referenceInfo.ReferenceConfiguration])) 172HashSet<ProjectGraphNode> GetTransitiveProjectReferencesExcludingSelf(ParsedProject parsedProject) 174if (transitiveReferenceCache.TryGetValue(parsedProject.GraphNode, out HashSet<ProjectGraphNode> transitiveReferences)) 191foreach (ProjectGraphNode transitiveReference in GetTransitiveProjectReferencesExcludingSelf(reference)) 203var projectsByPath = new Dictionary<string, List<ProjectGraphNode>>(); 209if (projectsByPath.TryGetValue(projectPath, out List<ProjectGraphNode> value)) 215projectsByPath[projectPath] = new List<ProjectGraphNode> { project.Value.GraphNode }; 228ErrorUtilities.VerifyThrow(projectsByPath.TryGetValue(referencedProjectPath, out List<ProjectGraphNode> projectToReturn), "nodes should include solution projects"); 232foreach (var referencingNode in referencingNodes) 234foreach (var referencedNode in referencedNodes) 441IReadOnlyCollection<ProjectGraphNode> entryPointNodes, 445var nodeStates = new Dictionary<ProjectGraphNode, NodeVisitationState>(); 447foreach (var entryPointNode in entryPointNodes) 464ProjectGraphNode node, 465IDictionary<ProjectGraphNode, NodeVisitationState> nodeState) 469foreach (var referenceNode in node.ProjectReferences) 541var graphNode = new ProjectGraphNode(projectInstance); 574private List<ProjectInterpretation.ReferenceInfo> ParseReferences(ProjectGraphNode parsedProject) 648private ConcurrentDictionary<(ProjectGraphNode, ProjectGraphNode), ProjectItemInstance> ReferenceItems = 649new ConcurrentDictionary<(ProjectGraphNode, ProjectGraphNode), ProjectItemInstance>(); 653public ProjectItemInstance this[(ProjectGraphNode node, ProjectGraphNode reference) key] 662public void AddOrUpdateEdge((ProjectGraphNode node, ProjectGraphNode reference) key, ProjectItemInstance edge) 667addValueFactory: static ((ProjectGraphNode node, ProjectGraphNode reference) key, ProjectItemInstance referenceItem) => referenceItem, 668updateValueFactory: static ((ProjectGraphNode node, ProjectGraphNode reference) key, ProjectItemInstance existingItem, ProjectItemInstance newItem) => 687static string GetEffectiveTargets(ProjectGraphNode reference, string targetsMetadata) 700public void RemoveEdge((ProjectGraphNode node, ProjectGraphNode reference) key) 705internal bool HasEdge((ProjectGraphNode node, ProjectGraphNode reference) key) => ReferenceItems.ContainsKey(key); 727public ProjectGraphNode GraphNode { get; } 730public ParsedProject(ConfigurationMetadata configurationMetadata, ProjectGraphNode graphNode, List<ProjectInterpretation.ReferenceInfo> referenceInfos)
Graph\GraphBuildRequestData.cs (2)
200foreach (ProjectGraphNode entryPoint in ProjectGraph.EntryPointNodes) 219ProjectGraphNode? 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)
20private readonly HashSet<ProjectGraphNode> _projectReferences = new HashSet<ProjectGraphNode>(); 21private readonly HashSet<ProjectGraphNode> _referencingProjects = new HashSet<ProjectGraphNode>(); 37public IReadOnlyCollection<ProjectGraphNode> ProjectReferences => _projectReferences; 42public IReadOnlyCollection<ProjectGraphNode> ReferencingProjects => _referencingProjects; 57internal void AddProjectReference(ProjectGraphNode reference, ProjectItemInstance projectReferenceItem, GraphBuilder.GraphEdges edges) 65internal void RemoveReference(ProjectGraphNode reference, GraphBuilder.GraphEdges edges) 75foreach (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)
4255var node1 = graph.ProjectNodes.First(node => node.ProjectInstance.FullPath.Equals(project1, StringComparison.OrdinalIgnoreCase)); 4259var node2 = graph.ProjectNodes.First(node => node.ProjectInstance.FullPath.Equals(project2, StringComparison.OrdinalIgnoreCase)); 4340var node1 = graph.ProjectNodes.First(node => node.ProjectInstance.FullPath.Equals(project1, StringComparison.OrdinalIgnoreCase)); 4344var node2 = graph.ProjectNodes.First(node => node.ProjectInstance.FullPath.Equals(project2, StringComparison.OrdinalIgnoreCase));
Graph\GraphLoadedFromSolution_tests.cs (7)
624var node1 = GetFirstNodeWithProjectNumber(graph, 1); 629var outerBuild3 = GetOuterBuild(graph, 3); 638IEnumerable<ProjectItemInstance> GetOutgoingEdgeItemsFromNode(ProjectGraphNode node, IReadOnlyDictionary<(ConfigurationMetadata, ConfigurationMetadata), ProjectItemInstance> edgeInfos) 643IEnumerable<ProjectItemInstance> GetIncomingEdgeItemsToNode(ProjectGraphNode node, IReadOnlyDictionary<(ConfigurationMetadata, ConfigurationMetadata), ProjectItemInstance> edgeInfos) 707foreach (var node in graphFromSolution.ProjectNodes) 715private static string GetConfiguration(ProjectGraphNode node) 720private 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)
15using ExpectedNodeBuildOutput = System.Collections.Generic.Dictionary<Microsoft.Build.Graph.ProjectGraphNode, string[]>; 16using OutputCacheDictionary = System.Collections.Generic.Dictionary<Microsoft.Build.Graph.ProjectGraphNode, string>; 327ProjectGraphNode[] topoSortedProjectGraphNodes = projectGraph.ProjectNodesTopologicallySorted.ToArray();
Graph\ProjectGraph_Tests.cs (108)
136var node = new ProjectGraphNode(projectInstance); 137var reference1 = new ProjectGraphNode(projectInstance); 140var reference2 = new ProjectGraphNode(projectInstance); 183var node = new ProjectGraphNode(projectInstance); 184var reference1 = new ProjectGraphNode(projectInstance); 263ProjectGraphNode node1 = GetFirstNodeWithProjectNumber(graph, 1); 264ProjectGraphNode node2 = GetFirstNodeWithProjectNumber(graph, 2); 265ProjectGraphNode node3 = GetFirstNodeWithProjectNumber(graph, 3); 266ProjectGraphNode node4 = GetFirstNodeWithProjectNumber(graph, 4); 267ProjectGraphNode node5 = GetFirstNodeWithProjectNumber(graph, 5); 268ProjectGraphNode node6 = GetFirstNodeWithProjectNumber(graph, 6); 269ProjectGraphNode node7 = GetFirstNodeWithProjectNumber(graph, 7); 370var root1 = GetFirstNodeWithProjectNumber(graph, 1); 377var root2 = GetFirstNodeWithProjectNumber(graph, 2); 467var node4A = GetFirstNodeWithProjectNumber(graph, 2).ProjectReferences.First(); 468var node4B = GetFirstNodeWithProjectNumber(graph, 3).ProjectReferences.First(); 582var node1 = GetFirstNodeWithProjectNumber(projectGraph, 1); 583var node2 = GetFirstNodeWithProjectNumber(projectGraph, 2); 584var node3 = GetFirstNodeWithProjectNumber(projectGraph, 3); 607var entryPointNode1 = projectGraph.EntryPointNodes.First(); 608var entryPointNode2 = projectGraph.EntryPointNodes.Last(); 646var entryPointNode1 = projectGraph.EntryPointNodes.First(); 647var entryPointNode2 = projectGraph.EntryPointNodes.Last(); 869ProjectGraphNode project1Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project1Path); 875ProjectGraphNode project2Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project2Path); 881ProjectGraphNode project3Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project3Path); 888ProjectGraphNode project4Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project4Path); 894ProjectGraphNode project5Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project5Path); 900ProjectGraphNode project6Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project6Path); 908ProjectGraphNode project8Node = projectGraph.ProjectNodes.Single(node => node.ProjectInstance.FullPath == project8Path); 928IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new[] { "A" }); 956IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new[] { "A" }); 987IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new[] { "A" }); 1009IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(null); 1027IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new[] { "Foo" }); 1050IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(null); 1073IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new[] { "A" }); 1116IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string> { "A" }); 1157IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string> { "A" }); 1191IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string> { "A" }); 1194var root = GetFirstNodeWithProjectNumber(projectGraph, 1); 1196var outerBuild = GetOuterBuild(projectGraph, 2); 1202foreach (var innerBuild in innerBuilds) 1256ProjectGraphNode rootOuterBuild = GetOuterBuild(graph, 1); 1257ProjectGraphNode nonRootOuterBuild = GetOuterBuild(graph, 3); 1262IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = graph.GetTargetLists(new[] { "A" }); 1266foreach (ProjectGraphNode innerBuild in GetInnerBuilds(graph, 1)) 1275foreach (ProjectGraphNode innerBuild in GetInnerBuilds(graph, 3)) 1363IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(new List<string> { "A" }); 1376void AssertMultitargetingNode(int projectNumber, ProjectGraph projectGraph, IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists, string[] outerBuildTargets, string[] nonOuterBuildTargets) 1380foreach (var innerBuild in GetInnerBuilds(projectGraph, projectNumber)) 1398IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(null); 1421IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(null); 1451IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(null); 1508IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(entryProjectTargets: null); 1553IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = graph.GetTargetLists(entryProjectTargets: new[] { "Build" }); 1560expectedNodeBuildOutput: new Dictionary<ProjectGraphNode, string[]>(), 1561outputCaches: new Dictionary<ProjectGraphNode, string>(), 1603IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = graph.GetTargetLists(entryProjectTargets: new[] { "Build" }); 1610expectedNodeBuildOutput: new Dictionary<ProjectGraphNode, string[]>(), 1611outputCaches: new Dictionary<ProjectGraphNode, string>(), 1634IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = graph.GetTargetLists(null); 1848Func<ProjectGraphNode, string> nodeIdProvider = GetProjectFileName; 1854foreach (var node in graph.ProjectNodes) 1866foreach (var reference in node.ProjectReferences) 1891var outerBuild = graph.GraphRoots.First(); 1918var outerBuild = GetOuterBuild(graph, 2); 1952var outerBuild = GetOuterBuild(graph, 2); 1956var outerBuildReferencingNode = GetFirstNodeWithProjectNumber(graph, 1); 1960foreach (var innerBuild in GetInnerBuilds(graph, 2)) 1985var rootOuterBuild = GetOuterBuild(graph, 1); 1986var nonRootOuterBuild = GetOuterBuild(graph, 2); 2006var nonMultitargetingNode = GetFirstNodeWithProjectNumber(graph, 2); 2034var nonMultitargetingNode = GetFirstNodeWithProjectNumber(graph, 2); 2053var nonMultitargetingNode = GetFirstNodeWithProjectNumber(graph, 2); 2106var innerBuildWithCommonReferences = GetNodesWithProjectNumber(graph, 1).First(n => n.ProjectInstance.GlobalProperties.TryGetValue(InnerBuildPropertyName, out string p) && p == "a"); 2112var innerBuildWithAdditionalReferences = GetNodesWithProjectNumber(graph, 1).First(n => n.ProjectInstance.GlobalProperties.TryGetValue(InnerBuildPropertyName, out string p) && p == "b"); 2139var outerBuild = graph.GraphRoots.First(i => i.ProjectType == ProjectInterpretation.ProjectType.OuterBuild); 2144var referencedInnerBuild = GetNodesWithProjectNumber(graph, 1).First(n => n.ProjectInstance.GetPropertyValue(InnerBuildPropertyName) == "a"); 2146var two = GetFirstNodeWithProjectNumber(graph, 2); 2173var rootNode = graph.GraphRoots.First(); 2177var innerBuildNode = rootNode.ProjectReferences.First(); 2217var outerBuild1 = GetOuterBuild(graph, 1); 2221var innerBuild1WithReferenceToInnerBuild2 = outerBuild1.ProjectReferences.FirstOrDefault(n => n.ProjectType == ProjectInterpretation.ProjectType.InnerBuild && n.ProjectInstance.GlobalProperties[InnerBuildPropertyName] == "a"); 2224var outerBuild2 = GetOuterBuild(graph, 2); 2227var innerBuild2 = GetInnerBuilds(graph, 2).FirstOrDefault(); 2335foreach (var node in projectGraph.ProjectNodes) 2365foreach (var node in graph.ProjectNodes) 2541foreach (var innerBuild in innerBuilds1) 2553foreach (var innerBuild in innerBuilds4) 2620var outerBuild1 = GetOuterBuild(graph, 1); 2628foreach (var inner1 in innerBuildsFor1) 2634var outerBuild2 = GetOuterBuild(graph, 2); 2641foreach (var inner2 in innerBuildsFor2) 2646var outerBuild3 = GetOuterBuild(graph, 3); 2655foreach (var inner3 in innerBuildsFor3) 2697IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = graph.GetTargetLists(Array.Empty<string>()); 2699ProjectGraphNode project1 = GetFirstNodeWithProjectNumber(graph, 1); 2700ProjectGraphNode project2 = GetFirstNodeWithProjectNumber(graph, 2); 2739IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = graph.GetTargetLists(Array.Empty<string>()); 2741ProjectGraphNode project1 = GetFirstNodeWithProjectNumber(graph, 1); 2742ProjectGraphNode project2 = GetFirstNodeWithProjectNumber(graph, 2); 2798IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = graph.GetTargetLists(Array.Empty<string>()); 2801foreach (ProjectGraphNode inner in GetInnerBuilds(graph, 1)) 2807foreach (ProjectGraphNode inner in GetInnerBuilds(graph, 2)) 2875ProjectGraphNode project1Node = GetFirstNodeWithProjectNumber(projectGraph, 1); 2876ProjectGraphNode project2Node = GetFirstNodeWithProjectNumber(projectGraph, 2); 2878IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetLists = projectGraph.GetTargetLists(entryTargets);
Graph\ResultCacheBasedBuilds_Tests.cs (10)
20using ExpectedNodeBuildOutput = System.Collections.Generic.Dictionary<Microsoft.Build.Graph.ProjectGraphNode, string[]>; 21using OutputCacheDictionary = System.Collections.Generic.Dictionary<Microsoft.Build.Graph.ProjectGraphNode, string>; 306foreach (var node in topoSortedNodes) 349var rootNode = topoSortedNodes.First(n => Path.GetFileNameWithoutExtension(n.ProjectInstance.FullPath) == "1"); 424IReadOnlyCollection<ProjectGraphNode> topoSortedNodes, 430Func<ProjectGraphNode, ExpectedNodeBuildOutput, string[]> expectedOutputProducer = null, 431IReadOnlyDictionary<ProjectGraphNode, ImmutableList<string>> targetListsPerNode = null, 444foreach (var node in topoSortedNodes) 491string[] ExpectedBuildOutputForNode(ProjectGraphNode node) 509private static string ProjectNumber(ProjectGraphNode node) => Path.GetFileNameWithoutExtension(node.ProjectInstance.FullPath);
ProjectCache\ProjectCacheTests.cs (16)
163public CacheResult GetExpectedCacheResultForNode(ProjectGraphNode node) 340public CacheResult GetCacheResultForNode(ProjectGraphNode node) 513var nodesToBuildResults = new Dictionary<ProjectGraphNode, BuildResult>(); 518foreach (var node in graph.ProjectNodesTopologicallySorted) 536(MockLogger logger, ProjectGraph graph, Dictionary<ProjectGraphNode, BuildResult> nodesToBuildResults) = BuildGraphVsScenario(testData, buildParameters); 560private (MockLogger logger, ProjectGraph projectGraph, Dictionary<ProjectGraphNode, BuildResult> nodesToBuildResults) BuildGraphVsScenario( 565var nodesToBuildResults = new Dictionary<ProjectGraphNode, BuildResult>(); 600foreach (var node in graph.ProjectNodesTopologicallySorted) 622foreach (var node in graph.ProjectNodes) 646private static string CreateSolutionConfigurationProperty(IReadOnlyCollection<ProjectGraphNode> projectNodes) 652foreach (var node in projectNodes) 702var rootNode = graph.GraphRoots.First(); 794IReadOnlyDictionary<ProjectGraphNode, BuildResult> projectPathToBuildResults, 810foreach (var node in graph.ProjectNodes) 850private static int GetProjectNumber(ProjectGraphNode node) => GetProjectNumber(node.ProjectInstance.FullPath); 1498foreach (var node in graph.ProjectNodes.Where(n => referenceNumbers.Contains(GetProjectNumber(n))))
SolutionFileBuilder.cs (1)
95n => GraphTestingUtilities.GetProjectNumber((ProjectGraphNode)n).ToString(),