-
Notifications
You must be signed in to change notification settings - Fork 515
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
[bgen] Add support for binding static members in protocols. #20645
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🔥 [CI Build] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 21 tests failed, 149 tests passed. Failures❌ interdependent-binding-projects tests
Html Report (VSDrops) Download ❌ linker tests
Html Report (VSDrops) Download ❌ mmp tests
Html Report (VSDrops) Download ❌ monotouch tests (iOS)
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Add support for binding static members in protocols. Given the following API definition: ```cs [Protocol] public interface Protocol { [Abstract] [Static] [Export ("requiredStaticMethod")] void RequiredStaticMethod (); [Static] [Export ("optionalStaticMethod")] void OptionalStaticMethod (); [Abstract] [Static] [Export ("requiredStaticProperty")] IntPtr RequiredStaticProperty { get; set; } [Static] [Export ("optionalStaticProperty")] IntPtr OptionalStaticProperty { get; set; } } ``` we're binding it like this: ```cs [Protocol ("Protocol")] public interface IProtocol : INativeObject { [Export ("requiredStaticMethod")] public static void RequiredStaticMethod<T> () where T: NSObject, IProtocol { /* implementation */ } [Export ("optionalStaticMethod")] public static void OptionalStaticMethod<T> () where T: NSObject, IProtocol { /* implementation */ } [Property ("RequiredStaticProperty")] [Export ("requiredStaticProperty")] public static IntPtr GetRequiredStaticProperty<T> () where T: NSObject, IProtocol { /* implementation */ } [Property ("RequiredStaticProperty")] [Export ("setRequiredStaticProperty:")] public static void SetRequiredStaticProperty<T> (IntPtr value) where T: NSObject, IProtocol { /* implementation */ } [Property ("OptionalStaticProperty")] [Export ("optionalStaticProperty")] public static IntPtr GetOptionalStaticProperty<T> () where T: NSObject, IProtocol { /* implementation */ } [Property ("OptionalStaticProperty")] [Export ("setOptionalStaticProperty:")] public static void SetOptionalStaticProperty<T> (IntPtr value) where T: NSObject, IProtocol { /* implementation */ } } ``` Also add documentation and tests.
0d3ae84
to
953e702
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! ❤️it!
I really wish we had extension properties in C# |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
📚 [PR Build] Artifacts 📚Packages generatedView packagesPipeline on Agent |
💻 [PR Build] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [PR Build] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [PR Build] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [PR Build] Tests on macOS M1 - Mac Big Sur (11) passed 💻✅ All tests on macOS M1 - Mac Big Sur (11) passed. Pipeline on Agent |
✅ API diff for current PR / commitLegacy Xamarin (No breaking changes)
.NET (No breaking changes)✅ API diff vs stableLegacy Xamarin (No breaking changes).NET (No breaking changes)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
💻 [CI Build] Windows Integration Tests passed 💻✅ All Windows Integration Tests passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 170 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. [attempt 2] Html Report (VSDrops) Download Pipeline on Agent |
Add support for binding static members in protocols.
Given the following API definition:
we're binding it like this:
Also add documentation and tests.