First pass, second pass compilation by structuring projects #131
Yeah69
started this conversation in
Show and tell
Replies: 1 comment
-
That's pretty cool - glad to hear that there is a workaround for running multiple source generators in order! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I appreciate your (@YairHalberstadt) initiative in dotnet/roslyn#48358. But I realized that I don't even have the problem. See:
How is it possible? Just a bit of architectural structuring with projects. See:
Meaning, that I use the application code projects as first pass (because as project dependencies they there compiled completely before compilation of the composition projects) and the composition projects as second pass. This architectural structure I came up with almost a year ago - when I still didn't know of Source Generators - in order to encapsulate the composition root and dependencies on dependency injection container packages. Hence, this is no "workaround" which I now came up with in order to be able to use StrongInject besides other Source Generators, but in my eyes and in this very case it is good design anyway.
Anyway, I was thinking of moving to StrongInject but the single pass compilation of Source Generators was bothering me the whole time, because I didn't want to miss using other (and even write my own) Source Generators, until I realized that it even isn't a problem for me. Maybe it is just me being really really stupid (wouldn't be the first time), but if someone has similar issues or mental blockades: you can still get something out of it with design!
However, I still think @YairHalberstadt 's suggestion is great, because it would give us the flexibility to not workaround missing passes by constraining us to use multiple projects. But I am happy that I realized that in my case I don't need to wait for the suggestion to become realized.
I'll try to move from the container I currently use (reflection-based) to StrongInject in the next weeks in my biggest open source project. I am looking forward to it!
Beta Was this translation helpful? Give feedback.
All reactions