CodeGenHelpers
CodeGenHelpers copied to clipboard
Ship V2 as a source generator instead of a library
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.