-
Notifications
You must be signed in to change notification settings - Fork 22
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
C# Source Generator instead of MSBuild task juggling #28
Comments
Hi Gulum, There is no plan for this, the MSBuild task just runs the slice2cs compiler which is a C++ binary. Can you elaborate on your use case and why you would prefer to have this in a source generator? Cheers, |
In our company we would like to generate slice files based on c# classes with the help of C# Source Generators. Those generators run as a part of the compiler. The Slice2CS generator runs upfront of the CSC compiler not allowing us to use outputs from the Source Generator. This forces us to also use MSBuild based generators to ensure correct generation order. E.g. Generate .ice files -> Generate C# files (Slice2CS) -> Run C# Compiler. From my point of view the Source Generators lacks features to allow such a flow anyway.
Both features are already on the Backlog of C#. So i might return to this request :). At the moment my question was out of curiosity if something like this is planned. Not a concrete request. However the mentioned lacking feature would not keep ICE from using Source Generators. Thanks |
One thing you can try is to run slice2cs from your generator, it shouldn't be too difficult using the Process class. For [IceRPC] our latest RPC product, we are planning to allow using Slice without Slice files, see icerpc/icerpc-csharp#4011 We are already using Source generators for Services https://docs.icerpc.dev/slice2/language-guide/interface#c#-mapping And we are planning to move code generation entirely to C# icerpc/icerpc-csharp#3978 |
How likely is it that the .ice Source file generation for C# will be migrated to C# Source Generators instead of MSBuild task juggling? Are there any plans?
The text was updated successfully, but these errors were encountered: