-
-
Notifications
You must be signed in to change notification settings - Fork 414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update CodeGen pacakge to use v0.7 of CodeGeneration.Roslyn #754
Conversation
The reference of the generator need to be modified according to https://github.com/AArnott/CodeGeneration.Roslyn#customize-generator-reference
b786c6a
to
2483130
Compare
How does it "not work"? I want to help. |
Uhmm, let me elaborate: Lets say there is As a consumer,
I first though that compiling Adding those references (especially
|
Ok, so:
Note that there's a major difference between using codegen P2P (ProjectReferefence) and as NuGets (PackageReference). Everything should be documented in CodeGeneration.Roslyn's Readme. :) |
As a library consumer, option 2 is the way to go right? The library author create a metapackage, the users just use the metapackage?
What you meant is directly referencing the |
As stated in the readme (and in AArnott/CodeGeneration.Roslyn#191 (comment)), the metapackage is only applicable for nuget consumer. When the generator lives in the same solution as the consumer, some modifications need to be done manually to the A local nuget source can be used for testing the nuget package locally though. Lots of thanks to @amis92 for helping me! |
Also a general note, it seems csproj files are using tab indent. |
Yeah, my visual studio is configured to use tabs... I will replace them with spaces for consistency. |
After this is done, can you please post an issue back in CG.R to add this in the Migration wiki as a helpful example? :) |
Like this? AArnott/CodeGeneration.Roslyn#223 |
@louthy If there's anything I can help with to push it, please don't hesitate to ask :) I'm eagerly awaiting wider adoption ;) |
Hi, please,I need this, I don't know why but I have both 3.1 and 2.1 runtime and sdk but vs for mac does not recognize me codegen |
@garyng I've made some pretty large changes since you started this. I'm ready to start looking into it, but I wonder if you'd mind closing this PR down and re-doing it with the latest Thanks! |
@louthy Sure! I'll look into it probably on the weekends. |
@garyng I'm going to close this down, because the next step probably will be with Source Generators. Thanks for the effort though, sorry it didn't work out. |
CodeGenerationAttribute
uses string instead of withtypeof
)TestBed
sampleUnion
andRecord
)Related to AArnott/CodeGeneration.Roslyn#191, AArnott/CodeGeneration.Roslyn#193
I'm not sure whether separating the project into a metapackage, generators, and attributes is necessary though. After some experimentation, the following usage does not work:1. a library that only references theAttributes
package2. a console app that reference the library, the
Generators
andAttributes
, andCodeGeneration.Roslyn.Tool
.The codegen will not run on the library unless it also references theGenerators
andCodeGeneration.Roslyn.Tool
.see #754 (comment)