Skip to content

We need a repo convention to ship source generators as part of the ref pack #61321

Closed
@ericstj

Description

@ericstj

I believe we want to ship the Regex source generator by default in .NET 7.0

I checked https://dev.azure.com/dnceng/public/_packaging?_a=package&feed=dotnet7&package=Microsoft.NETCore.App.Ref&protocolType=NuGet&version=7.0.0-alpha.1.21558.2
And noticed that it wasn't present.

I believe because it is not built as part of the normal build that produces the refpack. This is because there is no AnalyzerReference from the src project to the generator project and we have no convention to find and build generator projects as part of src.proj or ref.proj.

We should update the docs to indicate what steps are required (if any additional steps are necessary):
https://github.com/dotnet/runtime/blob/331823f4046da1530dd950ac3ad8a87b3cdd584d/docs/coding-guidelines/libraries-packaging.md#netcoreapp-shared-framework

Possible fixes here are:

  1. Require some building src project add an AnalyzerReference to the shipping source generator.
  2. Add some build convention to src.proj to build the generator.
  3. Some other build convention, eg generators.proj.

@stephentoub @joperezr @eerhardt @safern

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions