-
Notifications
You must be signed in to change notification settings - Fork 51
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
Provide a Source Generator backend in addition to the S.R.E backend. #79
Comments
@jkoritzinsky I agree, this would be really useful. I won't get to it on short term though. |
I've created #119 to expose a D-Bus protocol API. A source generator would target that API. |
The tool can now generate code that targets the Protocol API. It can only generate code for proxies (that is: to use an object from a service), not for adaptors (that is: to provide an object). If you want to try it (and maybe give feedback) you can grab packages of this NuGet feed: <add key="tmds" value="https://www.myget.org/F/tmds/api/v3/index.json" /> |
@jkoritzinsky any interest in being an early adopter of the Protocol library? |
I don't have time at the moment, but I'll pass this along to the other contributors to the project that prompted me to open this issue. |
I created a source generator some time ago that uses the new Protocol library, see https://github.com/affederaffe/Tmds.DBus.SourceGenerator.
I'd love to see those PRs merged within Avalonia 11, are there any plans on releasing Tmds.DBus.Protocol on NuGet? |
I like that you built a source-generator for the protocol library. Are you aware the Tmds.DBus.Tool can generate proxies for the protocol library?
I'll look at the PR.
And I'll make a release of the library in its current state by early next week. |
What it can't do is: generate code for you to implement objects to be made available through D-Bus. |
The source generator has some advantages over the Tmds.DBus.Tool generation:
Yes, it also generates abstract handler classes for the user to implement. Thanks, I appreciate your effort! |
I don't have issues adding generated code to a project.
I'm curious how your library handles a type like:
Tmds.DBus.Protocol supports variants as The code generated by
Nice! If it's ok with you, I'll put a reference to your generator on the README. |
Sure, that'd be great! |
@affederaffe I'll be making a release to nuget.org today. If you want to verify it will work for you, you can try with the latest CI build: |
The protocol library is now on nuget.org, and can be targeted using the source generator implemented by @affederaffe. |
Currently, using Tmds.DBus uses reflection exclusively to dynamically emit code to connect to D-Bus. With the new Roslyn source generators feature, it should be possible to provide a no-runtime-emit path via generated source. This would enable reliable usage with the IL Linker to help enable smaller program sizes with reliable functionality.
The text was updated successfully, but these errors were encountered: