[src] Generate accessors for native binding constants - #26290
[src] Generate accessors for native binding constants#26290rolfbjarne wants to merge 10 commits into
Conversation
Move eligible AddressBook, CoreFoundation, and OpenGLES constants into binding definitions while preserving existing public fields and properties. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bf11d7ec-2d59-4fad-876b-35900de01718
Keep the existing Contacts and Metal migration warnings on public partial constant-holder types. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bf11d7ec-2d59-4fad-876b-35900de01718
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.
Pull request overview
This PR migrates a set of OpenGLES, CoreFoundation, and AddressBook “native binding constants” from handwritten Dlfcn.Get* initialization patterns to bgen-generated [Field] accessors, with the intent of removing explicit static constructors and keeping the existing public surface shape.
Changes:
- Replaced manual constant initialization (static constructors / init coordinators) with bgen
[Field]-generated accessors for OpenGLES (EAGL*), CoreFoundation (CFErrorDomain/CFExceptionDataKey/CFPreferences), and AddressBook constants. - Removed the AddressBook
InitConstantscoordinator and related per-type initialization code. - Updated affected constant-holder types to
partialand routed their public fields/properties through internal generated accessors.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/OpenGLES/EAGLConsts.cs | Switches EAGL NSString constants to generated accessors; removes explicit static constructors. |
| src/opengles.cs | Adds [Field] definitions for EAGL constant symbols used by EAGLConsts.cs. |
| src/ObjCRuntime/Dlfcn.cs | Removes the handwritten Libraries.OpenGLES handle entry (now expected to be handled elsewhere). |
| src/CoreFoundation/CFPreferences.cs | Replaces static ctor-based constant initialization with generated [Field] accessor. |
| src/CoreFoundation/CFException.cs | Routes CF error-domain / error-key constants through generated accessors and removes static ctors. |
| src/corefoundation.cs | Adds bgen [Field] definitions backing CF constant accessors. |
| src/AddressBook/ABSource.cs | Removes manual property-id initialization and relies on generated constants. |
| src/AddressBook/ABPerson.cs | Removes manual constant initialization and InitConstants.Init () usage; prepares for generated constants. |
| src/AddressBook/ABGroup.cs | Removes manual constant initialization and InitConstants.Init () usage. |
| src/AddressBook/ABAddressBook.cs | Removes InitConstants and binds ErrorDomain via generated constant accessor. |
| src/addressbook.cs | Adds bgen [Field] definitions for AddressBook int/NSString/NSNumber constants. |
Keep legacy internal bindings and public readonly fields before XAMCORE 5, while exposing generated public properties in XAMCORE 5. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bf11d7ec-2d59-4fad-876b-35900de01718
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.
|
…cn-constants-src-only
Teach bgen to honor NullAllowed on Field properties and retain the nullable signatures of migrated AddressBook constants and future XAMCORE 5 properties. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: bf11d7ec-2d59-4fad-876b-35900de01718
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.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #f6bbca1] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 203 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Move eligible AddressBook, CoreFoundation, and OpenGLES constants from handwritten
Dlfcn.Get*Constantinitialization into bgen[Field]definitions.What changed
InitConstantscoordinator, handwritten loaders, and the now-unused OpenGLES library handle.!XAMCORE_5_0, while exposing public generated properties underXAMCORE_5_0.[NullAllowed]on[Field]properties, with focused regression coverage.Validation
This is a focused follow-up for #16672.
🤖 Pull request created by Copilot