CodeGenHelpers icon indicating copy to clipboard operation
CodeGenHelpers copied to clipboard

Ship V2 as a source generator instead of a library

Open Blackclaws opened this issue 6 months ago • 3 comments

Adding libraries to source generators as dependencies is notoriously hard:

https://github.com/dotnet/roslyn/blob/main/docs/features/source-generators.cookbook.md#use-functionality-from-nuget-packages

And it gets worse if multiple generators use the same library but in different versions as roslyn does not currently load them into different domains.

Instead I would suggest shipping V2 as a generator in its own right that simply adds these files post initialization so they are compiled into the source generator directly without people needing to copy things manually.

Blackclaws avatar Aug 01 '24 13:08 Blackclaws