[sharpie] Add --deepsplit option to split bindings into one file per source header#24883
[sharpie] Add --deepsplit option to split bindings into one file per source header#24883
Conversation
…source header Add a new --deepsplit CLI option that generates one .cs file per source header instead of a single ApiDefinition.cs. This makes it easier to navigate large framework bindings and map generated C# types back to their original Objective-C headers. The implementation adds a DeepSplitMassager that extracts the source header filename from each declaration's Clang annotation via Cursor.TryGetPresumedLoc, creates a DocumentSyntaxTree per unique header basename, and distributes declarations accordingly. Struct and enum declarations are consolidated in StructsAndEnums.cs. Declarations without source location info fall back to ApiDefinition.cs. Example: binding FBSDKCoreKit with --deepsplit produces 194 files (FBSDKAccessToken.cs, FBSDKGraphRequest.cs, etc.) instead of a single 7,688-line ApiDefinition.cs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
1 similar comment
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.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Resolve merge conflicts in ObjectiveCClass.cs where both the Scope_* tests (from main) and DeepSplit_* tests (from this branch) were added at the end of the file. Both test sets are preserved. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 #16a4b0d] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #16a4b0d] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ 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 |
✅ [CI Build #16a4b0d] Build passed (Build macOS tests) ✅Pipeline on Agent |
🚀 [CI Build #16a4b0d] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 156 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
Add a new --deepsplit CLI option that generates one .cs file per source header instead of a single ApiDefinition.cs. This makes it easier to navigate large framework bindings and map generated C# types back to their original Objective-C headers.
The implementation adds a DeepSplitMassager that extracts the source header filename from each declaration's Clang annotation via Cursor.TryGetPresumedLoc, creates a DocumentSyntaxTree per unique header basename, and distributes declarations accordingly. Struct and enum declarations are consolidated in StructsAndEnums.cs. Declarations without source location info fall back to ApiDefinition.cs.
Example: binding FBSDKCoreKit with --deepsplit produces 194 files (FBSDKAccessToken.cs, FBSDKGraphRequest.cs, etc.) instead of a single 7,688-line ApiDefinition.cs.
Fixes #23024.