Skip to content

Conversation

@jpnurmi
Copy link
Collaborator

@jpnurmi jpnurmi commented Sep 2, 2025

WIP

  1. Lets Objective Sharpie generate bindings for everything in Sentry-Swift.h (Obj-C header auto-generated by the Swift compiler)
  2. Uses Roslyn to filter out unnecessary C# types in ApiDefinitions.cs (because doing the same with regexps in PWSH is extremely difficult to get right)

#skip-changelog

@jpnurmi jpnurmi changed the title Generate bindings from Sentry-Swift.h Generate Cocoa bindings from Sentry-Swift.h Sep 2, 2025
@jpnurmi jpnurmi changed the title Generate Cocoa bindings from Sentry-Swift.h build: Generate Cocoa bindings from Sentry-Swift.h Sep 2, 2025
jpnurmi added a commit that referenced this pull request Sep 3, 2025
@codecov
Copy link

codecov bot commented Oct 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (version6@33615f4). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff             @@
##             version6    #4488   +/-   ##
===========================================
  Coverage            ?   73.09%           
===========================================
  Files               ?      479           
  Lines               ?    17386           
  Branches            ?     3432           
===========================================
  Hits                ?    12709           
  Misses              ?     3818           
  Partials            ?      859           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi jpnurmi changed the title build: Generate Cocoa bindings from Sentry-Swift.h build: Generate Swift types from Sentry-Swift.h Oct 7, 2025
@jpnurmi jpnurmi changed the base branch from main to version6 October 8, 2025 10:53
@jpnurmi
Copy link
Collaborator Author

jpnurmi commented Oct 23, 2025

@jamescrosswell @Flash0ver There haven't been any Swift binding updates that required manual intervention recently, so I forgot I had this PR lying here. This can generate C# bindings for Swift types, so we'd no longer need those error-prone, manually crafted bindings in SwiftApiDefinitions.cs and SwiftStructsAndEnumes.cs. How do you like the approach? I think this PR in its current state would be a reasonable first step. Later on, we could even move more of that regexp manipulation from PWSH to C# and Roslyn to make it subjectively easier to maintain...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant