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
Right now the builders are created in the same project where the decorated classes live in.
Given that the Attributes and the SourceGenerator and already split in two NuGet packages, I would like to be able to decorate the classes in the production project, but create the Data Builders in the test project.
Example:
TestApp
Dependencies
Packages
DataBuilderGenerator.Attributes
Person.cs
TestApp.Tests
Dependencies
Analyzers
DataBuilderGenerator
Packages
DataBuilderGenerator
After building the solution:
TestApp.Tests
Dependencies
Analyzers
DataBuilderGenerator
PersonBuilder.cs
Packages
DataBuilderGenerator
This way, production code is not polluted with testing code.
Do you have any directions on how to achieve this?
The text was updated successfully, but these errors were encountered:
That also has the added benefit of being able to look at the metadata of the referenced assembly instead of the syntactic/semantic models of the code being built to generate the code, that could benefit from Roslyn 4's incremental generator feature
So I am trying to follow that same approach where a nuget is added to a unit testing project and it automatically generates whatever files are needed, in this repo:
Right now the builders are created in the same project where the decorated classes live in.
Given that the Attributes and the SourceGenerator and already split in two NuGet packages, I would like to be able to decorate the classes in the production project, but create the Data Builders in the test project.
Example:
TestApp
Person.cs
TestApp.Tests
After building the solution:
TestApp.Tests
PersonBuilder.cs
This way, production code is not polluted with testing code.
Do you have any directions on how to achieve this?
The text was updated successfully, but these errors were encountered: