https://github.com/cezarypiatek/smartcodegenerator
https://github.com/cezarypiatek/smartcodegenerator
roslyn
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cezarypiatek/smartcodegenerator
- Owner: cezarypiatek
- License: ms-pl
- Created: 2019-10-16T05:24:46.000Z (almost 6 years ago)
- Default Branch: feature/amazing_refactor
- Last Pushed: 2022-12-08T06:54:18.000Z (almost 3 years ago)
- Last Synced: 2025-06-26T15:18:02.707Z (3 months ago)
- Topics: roslyn
- Language: C#
- Homepage:
- Size: 489 KB
- Stars: 38
- Watchers: 5
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.txt
Awesome Lists containing this project
README
This project is a completely refactored version of [CodeGeneration.Roslyn](https://github.com/AArnott/CodeGeneration.Roslyn)
## How to create a custom plugin
1. Create .NET Core 3.0+ project
2. Install `SmartCodeGenerator.Sdk` NuGet package
3. Define the attribute that will be used for marking places that trigger your code generation plugin
4. Create a class that implements `SmartCodeGenerator.Sdk.ICodeGenerator` and it's marked with `[CodeGenerator()]` attribute.
5. Build your project and publish the NuGet package.## How to use a custom plugin
1. Install `SmartCodeGenerator.Engine` NuGet package
2. Install the package with your plugin
3. Add source code of the marking attribute into your codebase
4. 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.