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

MSBuild tasks should list the roslyn version #52265

Closed
chsienki opened this issue Mar 30, 2021 · 2 comments
Closed

MSBuild tasks should list the roslyn version #52265

chsienki opened this issue Mar 30, 2021 · 2 comments

Comments

@chsienki
Copy link
Member

chsienki commented Mar 30, 2021

When going from an external generator to a SourceGenerator, it is required to know if the SDK supports source generators, and fall back to the existing logic when it doesn't.

This is roughly achievable by looking at the EmitCompilerGeneratedFiles property and seeing if it has a value (it's always set to something when generators are supported), but it would be nice to have a single property that user can check in SDKs going forward.

We should also probably version it, so the MSBuild layer knows what compiler features are available.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 30, 2021
@chsienki chsienki changed the title MSBuild tasks don' MSBuild tasks don't supply a way to discover if generators are supported Mar 30, 2021
@chsienki
Copy link
Member Author

Actually, maybe we should just start embedding the Roslyn version in the targets file, so external tasks can easily calculate what is / isn't supported by version?

@jaredpar jaredpar added Feature Request Feature - Source Generators Source Generators and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 20, 2021
@jaredpar jaredpar modified the milestones: 16.10, C# 10 Apr 20, 2021
@jaredpar jaredpar modified the milestones: C# 10, 17.0 Jun 18, 2021
@chsienki chsienki changed the title MSBuild tasks don't supply a way to discover if generators are supported MSBuild tasks should list the roslyn version Aug 13, 2021
eerhardt added a commit to eerhardt/roslyn that referenced this issue Sep 16, 2021
This allows other targets to understand which compiler will be used.
This is useful in the SDK targets that need figure out the version in order to pick the right analyzer assets.

Contributes to dotnet#52265
jaredpar pushed a commit that referenced this issue Sep 22, 2021
* Set CompilerApiVersion in Microsoft.Managed.Core.targets

This allows other targets to understand which compiler will be used.
This is useful in the SDK targets that need figure out the version in order to pick the right analyzer assets.

Contributes to #52265

* Fix desktop NuGet package to include the new generated CurrentVersions.targets file.
@chsienki
Copy link
Member Author

Closed via #56460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants