As a nuget package the same as Fody
Optionally replace/add cs files to the build pipeline in a similar wat to GFV
https://github.com/Particular/GitFlowVersion/blob/master/GitFlowVersionTask/UpdateAssemblyInfo.cs#L25 https://github.com/Particular/GitFlowVersion/blob/master/GitFlowVersionTask/NugetAssets/GitFlowVersionTask.targets#L26
So at build time all the cs can be loaded into a roslyn model and passed to the addins for manipulation
Nuget packages with a naming convention the same as fody
Each addin gets access to roslyn model for the current project and can choose to manipulate it
Possible write new cs file to build temp in the same way that Costura does??
This is definitely possible, and even the Roslyn team have said they'll support code injection, just possibly not for the first release.
About the only issue is this only applies to code the CS compiler can produce. I'm not sure how it works for doing weirder stuff like injecting code into the ModuleInit.
Another thing I've been thinking about is having an easier way to inject code. I've been looking at AspectJ and how it does aspect injection. We could borrow concepts from there (join points, pointcuts) and use Roslyn to take C# code from the weaver, turn that into an AST and insert it into the right spot of the main codes AST. This would make weaver writing much easier as you wouldn't need to know IL.