You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With EasySourceGenerators, you can write your generator code as a normal method, in the same assembly as the output.
6
-
This allows you to write your generator in a more natural way, without having to deal with the complexities of Roslyn Source Generators and a separate Project.
5
+
**Easy Source Generators** - Code generation made easy.
7
6
8
-
## What it does
9
-
10
-
You declare partial methods and provide generator methods marked with attributes such as:
11
-
-`[GeneratesMethod(...)]`
12
-
-`[SwitchCase(...)]`
13
-
-`[SwitchDefault]`
7
+
With this package, you can easily create **code that generates source** - without creating a separate Analyzers assembly and without learning Roslyn Source Generators. It will be generated any time you run a build.
14
8
15
-
The generator then emits the final method body at compile time.
9
+
Just look at the examples below, or scroll down to a more in-depth explanation.
@@ -113,6 +108,26 @@ public static partial Mammal MapToMammal(FourLegged fourLegged)
113
108
}
114
109
```
115
110
111
+
#### More examples
112
+
See the full example project here: [`/EasySourceGenerators.Examples`](./EasySourceGenerators.Examples).
113
+
114
+
## What it does
115
+
116
+
You declare partial methods and provide generator methods marked with attributes such as:
117
+
-`[GeneratesMethod(...)]`
118
+
-`[SwitchCase(...)]`
119
+
-`[SwitchDefault]`
120
+
121
+
The generator uses Roslyn Source Generators under the hood to generate the source in build time.
122
+
123
+
The Generators package and binaries is not going to be added to your shipped code. The generators package will be added as a compile-time only dependency:
See the full example project here: [`/EasySourceGenerators.Examples`](./EasySourceGenerators.Examples).
141
+
Remove the guesswork from Source Generators mistakes.
142
+
143
+
Roslyn Source Generator projects often produce errors that are hard to understand. One of the main goals for this package is to make sure all errors, including user errors, setup errors, and edgecases are verbose and easily visible as an error line in your IDE.
0 commit comments