This project is a completely refactored version of CodeGeneration.Roslyn
- Create .NET Core 3.0+ project
- Install
SmartCodeGenerator.SdkNuGet package - Define the attribute that will be used for marking places that trigger your code generation plugin
- Create a class that implements
SmartCodeGenerator.Sdk.ICodeGeneratorand it's marked with[CodeGenerator()]attribute. - Build your project and publish the NuGet package.
- Install
SmartCodeGenerator.EngineNuGet package - Install the package with your plugin
- Add source code of the marking attribute into your codebase
- Since now you can start marking code with your attribute and after recompilation, the generated code should be available at your disposal.
IMPORTANT: The source code of the marking attribute need to be copied into a consuming project because there should be no runtime dependency between the project that uses the generator plugin and the generator plugin itself.