Skip to content

Instantly share code, notes, and snippets.

@SimonCropp
Last active April 30, 2016 08:55
Show Gist options
  • Save SimonCropp/8485964 to your computer and use it in GitHub Desktop.
Save SimonCropp/8485964 to your computer and use it in GitHub Desktop.
Roslyn weaver

Roslyn Weaver

deployed

As a nuget package the same as Fody

Injection into the pipeline

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

Extended

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

Debugging

Possible write new cs file to build temp in the same way that Costura does??

@distantcam
Copy link

I've created a proof of concept for syntax rewriting.

https://github.com/distantcam/RoslynSandbox

It works pretty well, and there's no IL code writing anywhere in sight.

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