dotnet / dotnet/msbuild

Expose GetNodeFor* method on the project graph

Open
#3,798 0 comments 0 reactions 0 assignees View on GitHub
Area: Static Graph triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

Currently we only expose entry points and an unordered list of nodes.

It would be convenient to allow API consumers to fetch a node by project file. One wrinkle is that a project make actually have multiple nodes if global properties are different. We'll need to think about how the API looks.

Idea:
```
// Common case is no global props, so make that convenient. This can likely be a O(1) lookup.
ProjectGraphNode GetNodeForProject(string projectFile, IDictionary globalProperties = null)

// Gets all nodes matching the project name. This will likely be an O(n) search.
ProjectGraphNode[] GetNodesForProject(string projectFile)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.