Skip to content

Commit efef94f

Browse files
authored
Merge pull request #533 from ignatandrei/IncrementalSourceGenerator.BuilderPattern
example
2 parents 27f9f08 + b96d1dd commit efef94f

28 files changed

Lines changed: 661 additions & 22 deletions

README.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# RSCG - 282 Examples of Roslyn Source Code Generators / 16 created by Microsoft /
1+
# RSCG - 283 Examples of Roslyn Source Code Generators / 16 created by Microsoft /
22

3-
The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 282 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports.
3+
The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 283 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports.
44

55
This system serves as both a learning resource for .NET developers interested in source generators and an automated pipeline for maintaining up-to-date documentation about the RSCG ecosystem
66

7-
## Latest Update : 2026-08-22 => 22 August 2026
7+
## Latest Update : 2026-08-23 => 23 August 2026
88

99
If you want to see examples with code, please click ***[List V2](https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG)***
1010

@@ -24,8 +24,32 @@ If you want to be notified each time I add a new RSCG example , please click htt
2424

2525
## Content
2626

27-
Those are the 282 Roslyn Source Code Generators that I have tested you can see and download source code example.
27+
Those are the 283 Roslyn Source Code Generators that I have tested you can see and download source code example.
2828
( including 16 from Microsoft )
29+
### 283. [IncrementalSourceGenerator.BuilderPattern](https://ignatandrei.github.io/RSCG_Examples/v2/docs/IncrementalSourceGenerator.BuilderPattern) , in the [Builder](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#builder) category
30+
31+
Generated on : 2026-08-23 => 23 August 2026
32+
33+
<details>
34+
<summary>Expand</summary>
35+
36+
37+
38+
Author: Martin Barrett Nielsen
39+
40+
Incremental source generator that that reduces boilerplate in test object builders
41+
by generating the repetitive structure, while enabling developers to focus on the
42+
more meaningful, hand-crafted logic via partial classes
43+
44+
Nuget: [https://www.nuget.org/packages/IncrementalSourceGenerator.BuilderPattern/](https://www.nuget.org/packages/IncrementalSourceGenerator.BuilderPattern/)
45+
46+
47+
Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/IncrementalSourceGenerator.BuilderPattern](https://ignatandrei.github.io/RSCG_Examples/v2/docs/IncrementalSourceGenerator.BuilderPattern)
48+
49+
Source: [https://github.com/MartinBarrettNielsen11/Incremental-source-generator-builder-pattern](https://github.com/MartinBarrettNielsen11/Incremental-source-generator-builder-pattern)
50+
51+
</details>
52+
2953
### 282. [Clap.Net](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Clap.Net) , in the [CommandLine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#commandline) category
3054

3155
Generated on : 2026-08-22 => 22 August 2026

later.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Just later
22

3-
## Latest Update : 2026-08-22 => 22 August 2026
3+
## Latest Update : 2026-08-23 => 23 August 2026
44

55

66

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
{
3+
"$schema": "https://aka.ms/codetour-schema",
4+
"title": "IncrementalSourceGenerator.BuilderPattern",
5+
"steps":
6+
[
7+
{
8+
"file": "rscg_examples/IncrementalSourceGenerator.BuilderPattern/src/Builder/Builder.csproj",
9+
"description": "First, we add Nuget [IncrementalSourceGenerator.BuilderPattern](https://www.nuget.org/packages/IncrementalSourceGenerator.BuilderPattern/) in csproj ",
10+
"pattern": "IncrementalSourceGenerator.BuilderPattern"
11+
}
12+
13+
,{
14+
"file": "rscg_examples/IncrementalSourceGenerator.BuilderPattern/src/Builder/Person.cs",
15+
"description": "File Person.cs ",
16+
"pattern": "this is the code"
17+
}
18+
19+
,{
20+
"file": "rscg_examples/IncrementalSourceGenerator.BuilderPattern/src/Builder/Program.cs",
21+
"description": "File Program.cs \r\n>> dotnet run --project rscg_examples/IncrementalSourceGenerator.BuilderPattern/src/Builder/Builder.csproj ",
22+
"pattern": "this is the code"
23+
}
24+
25+
26+
,{
27+
"file": "rscg_examples/IncrementalSourceGenerator.BuilderPattern/src/Builder/obj/GX/Generator/Generator.Generator/DomainAssertionExtensions.g.cs",
28+
"description": "Generated File 4 from 4 : DomainAssertionExtensions.g.cs ",
29+
"line": 1
30+
}
31+
32+
,{
33+
"file": "rscg_examples/IncrementalSourceGenerator.BuilderPattern/src/Builder/obj/GX/Generator/Generator.Generator/Builder_PersonBuilder.g.cs",
34+
"description": "Generated File 3 from 4 : Builder_PersonBuilder.g.cs ",
35+
"line": 1
36+
}
37+
38+
,{
39+
"file": "rscg_examples/IncrementalSourceGenerator.BuilderPattern/src/Builder/obj/GX/Generator/Generator.Generator/Builder_Person.g.cs",
40+
"description": "Generated File 2 from 4 : Builder_Person.g.cs ",
41+
"line": 1
42+
}
43+
44+
,{
45+
"file": "rscg_examples/IncrementalSourceGenerator.BuilderPattern/src/Builder/obj/GX/Generator/Generator.Generator/BuilderAttribute.g.cs",
46+
"description": "Generated File 1 from 4 : BuilderAttribute.g.cs ",
47+
"line": 1
48+
}
49+
50+
],
51+
52+
"ref": "main"
53+
54+
}

v2/Generator/all.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,4 @@ Nr,Key,Source,Category
281281
280,serde, https://github.com/serdedotnet/serde,Serializer
282282
281,EndpointHelpers, https://github.com/gumbarros/EndpointHelpers,MVC
283283
282,Clap.Net, https://github.com/simon-curtis/Clap.Net,CommandLine
284+
283,IncrementalSourceGenerator.BuilderPattern, https://github.com/MartinBarrettNielsen11/Incremental-source-generator-builder-pattern,Builder

v2/RSCGExamplesData/GeneratorDataRec.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,12 @@
17091709
"Category":32,
17101710
"dtStart": "2026-08-22T00:00:00",
17111711
"show": true
1712+
},
1713+
{
1714+
"ID":"IncrementalSourceGenerator.BuilderPattern",
1715+
"Category": 4,
1716+
"dtStart": "2026-08-23T00:00:00",
1717+
"show": true
17121718
}
17131719

17141720
]
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
2+
<h1>RSCG nr 283 : IncrementalSourceGenerator.BuilderPattern</h1>
3+
4+
<h2>Info</h2>
5+
Nuget : <a href="https://www.nuget.org/packages/IncrementalSourceGenerator.BuilderPattern/" target="_blank">https://www.nuget.org/packages/IncrementalSourceGenerator.BuilderPattern/</a>
6+
7+
<p>You can find more details at : <a href="https://github.com/MartinBarrettNielsen11/Incremental-source-generator-builder-pattern" target="_blank"> https://github.com/MartinBarrettNielsen11/Incremental-source-generator-builder-pattern</a></p>
8+
9+
<p>Author :Martin Barrett Nielsen</p>
10+
11+
<p>Source: <a href="https://github.com/MartinBarrettNielsen11/Incremental-source-generator-builder-pattern" target="_blank">https://github.com/MartinBarrettNielsen11/Incremental-source-generator-builder-pattern</a> </p>
12+
13+
<h2>About</h2>
14+
15+
Generate builder pattern code for classes with many properties
16+
17+
<h2>
18+
How to use
19+
</h2>
20+
<h3>
21+
Add reference to the <a href="https://www.nuget.org/packages/IncrementalSourceGenerator.BuilderPattern/" target="_blank">IncrementalSourceGenerator.BuilderPattern</a> in the csproj
22+
</h3>
23+
<img src="images/IncrementalSourceGenerator.BuilderPattern/Builder.csproj.png" width="580" height="580" />
24+
25+
<h3>This was for me the <b>starting</b> code</h3>
26+
27+
<br />
28+
I have <b>coded</b> the file Program.cs
29+
<br />
30+
<img src="images/IncrementalSourceGenerator.BuilderPattern/csFiles/Program.cs.png" width="580" height="580" />
31+
<hr />
32+
33+
<br />
34+
I have <b>coded</b> the file Person.cs
35+
<br />
36+
<img src="images/IncrementalSourceGenerator.BuilderPattern/csFiles/Person.cs.png" width="580" height="580" />
37+
<hr />
38+
<h3>And here are the <i>generated</i> files</h3>
39+
40+
<br />
41+
The file <i>generated</i> is BuilderAttribute.g.cs
42+
<br />
43+
<img src="images/IncrementalSourceGenerator.BuilderPattern/generated/BuilderAttribute.g.cs.png" width="580" height="580" />
44+
45+
<br />
46+
The file <i>generated</i> is Builder_Person.g.cs
47+
<br />
48+
<img src="images/IncrementalSourceGenerator.BuilderPattern/generated/Builder_Person.g.cs.png" width="580" height="580" />
49+
50+
<br />
51+
The file <i>generated</i> is Builder_PersonBuilder.g.cs
52+
<br />
53+
<img src="images/IncrementalSourceGenerator.BuilderPattern/generated/Builder_PersonBuilder.g.cs.png" width="580" height="580" />
54+
55+
<br />
56+
The file <i>generated</i> is DomainAssertionExtensions.g.cs
57+
<br />
58+
<img src="images/IncrementalSourceGenerator.BuilderPattern/generated/DomainAssertionExtensions.g.cs.png" width="580" height="580" />
59+
60+
<p>
61+
You can download the code and this page as pdf from
62+
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/IncrementalSourceGenerator.BuilderPattern'>
63+
https://ignatandrei.github.io/RSCG_Examples/v2/docs/IncrementalSourceGenerator.BuilderPattern
64+
</a>
65+
</p>
66+
67+
68+
<p>
69+
You can see the whole list at
70+
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'>
71+
https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG
72+
</a>
73+
</p>
74+

v2/book/list.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</head>
1818
<body>
1919
<h1>
20-
This is the list of 282 RSCG with examples =>
20+
This is the list of 283 RSCG with examples =>
2121
</h1>
2222

2323
<table >
@@ -1154,6 +1154,10 @@ <h1>
11541154
<td>282</td>
11551155
<td><a href="examples/Clap.Net.html">Clap.Net</a></td>
11561156
</tr>
1157+
<tr>
1158+
<td>283</td>
1159+
<td><a href="examples/IncrementalSourceGenerator.BuilderPattern.html">IncrementalSourceGenerator.BuilderPattern</a></td>
1160+
</tr>
11571161
</table>
11581162

11591163

v2/book/pandocHTML.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ input-files:
296296
- examples/serde.html
297297
- examples/EndpointHelpers.html
298298
- examples/Clap.Net.html
299+
- examples/IncrementalSourceGenerator.BuilderPattern.html
299300

300301
# or you may use input-file: with a single value
301302
# defaults:

v2/docFind.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,5 +1690,11 @@
16901690
"category": "CommandLine",
16911691
"href": "/RSCG_Examples/v2/docs/Clap.Net/",
16921692
"body": "Package Description"
1693+
},
1694+
{
1695+
"title": "IncrementalSourceGenerator.BuilderPattern",
1696+
"category": "Builder",
1697+
"href": "/RSCG_Examples/v2/docs/IncrementalSourceGenerator.BuilderPattern/",
1698+
"body": "Incremental source generator that that reduces boilerplate in test object builders \n by generating the repetitive structure, while enabling developers to focus on the \n more meaningful, hand-crafted logic via partial classes"
16931699
}
16941700
]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"generator":{
3+
"name":"IncrementalSourceGenerator.BuilderPattern",
4+
"nuget":[
5+
"https://www.nuget.org/packages/IncrementalSourceGenerator.BuilderPattern/"
6+
],
7+
"link":"https://github.com/MartinBarrettNielsen11/Incremental-source-generator-builder-pattern",
8+
"author":"Martin Barrett Nielsen",
9+
"source":"https://github.com/MartinBarrettNielsen11/Incremental-source-generator-builder-pattern"
10+
},
11+
"data":{
12+
"goodFor":["Generate builder pattern code for classes with many properties"],
13+
"csprojDemo":"Builder.csproj",
14+
"csFiles":["Program.cs","Person.cs"],
15+
"excludeDirectoryGenerated":[""],
16+
"includeAdditionalFiles":[""]
17+
},
18+
"links":{
19+
"blog":"",
20+
"video":""
21+
}
22+
}

0 commit comments

Comments
 (0)