Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Add ProjectGraph APIs for target framework negotiation #10044

Open
tmat opened this issue Apr 19, 2024 · 0 comments
Open

[Feature Request]: Add ProjectGraph APIs for target framework negotiation #10044

tmat opened this issue Apr 19, 2024 · 0 comments
Labels
Area: Static Graph Issues with -graph, -isolate, and the related APIs. backlog Feature Request Priority:2 Work that is important, but not critical for the release triaged

Comments

@tmat
Copy link
Member

tmat commented Apr 19, 2024

Summary

With current ProjectGraph APIs one can analyze project dependencies and retrieve evaluation results. However, given a (multi-targeted) project and a TFM we can't determine from the graph, which nodes of the referenced multi-targeted projects match that specific TFM. This makes it hard to determine values of properties/items across project dependencies.

Background and Motivation

dotnet-watch uses ProjectGraph to determine various properties of the projects that affect its behavior. E.g. to distinguish between Blazor Hosted app and Blazor WASM client app we need to look at project dependencies and check their ProjectCapability items. Currently these specific capabilities do not change between TFMs in practice. However, it is entirely possible that in future we might encounter such scenarios, or other cases where we need to analyze TFM-specific project dependency.

Proposed Feature

There are multiple options how this feature may be implemented and exposed as public API.

One option is, for example, to specify an optional parameter to the ProjectGraph constructor that instructs it to only include project nodes that match the given TFM (create a subgraph).

Another option might be to add method ProjectGraphNode? GetProjectReference(string targetFramework) that returns the node that matches the given TFM for each project node (or null if none does).

Alternative Designs

No response

@AR-May AR-May added backlog Area: Static Graph Issues with -graph, -isolate, and the related APIs. Priority:2 Work that is important, but not critical for the release triaged labels Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Static Graph Issues with -graph, -isolate, and the related APIs. backlog Feature Request Priority:2 Work that is important, but not critical for the release triaged
Projects
None yet
Development

No branches or pull requests

2 participants