-
-
Notifications
You must be signed in to change notification settings - Fork 395
feat(objc): Add SentryObjC wrapper SDK #7598
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
base: main
Are you sure you want to change the base?
Changes from 116 commits
74600ce
2df1ab3
bb4bcf2
50e07e7
2ac98e0
434212c
4074c02
59fa2dc
0e7e483
7b315e6
96cd092
16d4dea
bf8a253
e5e4882
ba08e46
33dd2c7
e4b4486
913cdfd
e1eebdf
97f6f13
ab571ff
7a81302
56bdb7c
5cc3e0d
e2a7aa0
6ee408f
82bdd16
cff540f
8e6c132
5c6380c
f4293bc
9e207fa
1b9dab0
9ecf30b
74f68ad
beb048f
2d3b0ce
34ccdb8
91d834c
4b6bc65
42bf54e
0d1d853
e5e8c71
3b6f320
e479465
fc356b3
dad81ef
6336858
8d92c5e
22824e5
d44c00f
fc4682e
acd8515
abcc681
16f9238
143a0d6
6189f81
37eade3
9521b48
5043b1f
31cd646
bf8027a
f4d732b
f7e40e5
b37e7c5
f05c5fe
05ee02e
e20405b
d8a3411
3aeab3b
6bbc7b8
bc0702c
2091b12
e12d8c2
b2bae60
996eebd
8dff640
7862661
82267fd
cf4d8d5
085fb2f
c7413b7
cba25e6
57f21f8
c78ece6
9bd6dc9
eef8a98
b75b8c3
0bac2e7
13884da
2959f85
fbf9630
22bf30a
dbfa925
60ee593
3f74206
9576df3
2b85a0a
050a495
f79a2a6
851fa82
5c0b199
d76d0f3
256afdf
19a990e
feb95e2
7750de9
d59bdc8
5091a7b
f82fab2
f4a6349
6d69018
7d64c08
71b37df
b4cb6b3
10b742e
1a5beca
83f3adb
c5ee059
4762be5
903c158
de97037
162db30
5b8f571
2939d41
ec2e43a
fbc1c97
854e3f7
8bfffbd
45192ca
2ad4c75
0fe8acd
e97e252
63f1719
d8ab12b
8ca4e35
4ef64c3
5019f15
bc0801f
cb9bee2
18e1f5f
4c526ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| name: Assemble SentryObjC XCFramework | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| sdks: | ||
| description: |- | ||
| Comma-separated list of SDK slices to assemble. | ||
| required: false | ||
| type: string | ||
| default: "iphoneos,iphonesimulator,macosx,maccatalyst,appletvos,appletvsimulator,watchos,watchsimulator,xros,xrsimulator" | ||
|
|
||
| signed: | ||
| description: |- | ||
| Whether or not the assembled XCFramework should be signed. | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
|
|
||
| release-version: | ||
| description: |- | ||
| For release workflows, the version to inject into the SDK. | ||
| required: false | ||
| type: string | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| jobs: | ||
| assemble-xcframework-sentryobjc: | ||
| name: SentryObjC | ||
| runs-on: macos-15 | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | ||
| - uses: ./.github/actions/setup-xcode | ||
| with: | ||
| version: "16.4" | ||
|
|
||
| - name: Setup Ruby | ||
| uses: ruby/setup-ruby@4eb9f110bac952a8b68ecf92e3b5c7a987594ba6 # v1.292.0 | ||
| if: ${{ inputs.signed }} | ||
| with: | ||
| bundler-cache: true | ||
|
|
||
| - name: "Download Fastlane Certificate" | ||
| if: ${{ inputs.signed }} | ||
| run: bundle exec fastlane prepare_xcframework_signing | ||
| env: | ||
| FASTLANE_KEYCHAIN_PASSWORD: ${{ secrets.FASTLANE_KEYCHAIN_PASSWORD }} | ||
| MATCH_GIT_PRIVATE_KEY: ${{ secrets.MATCH_GIT_PRIVATE_KEY }} | ||
| MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | ||
| MATCH_USERNAME: ${{ secrets.MATCH_USERNAME }} | ||
|
|
||
| # Download all four sets of static library slices. | ||
| # Each artifact contains a {sdk}.xcarchive.zip for one platform. | ||
| - name: Download Sentry static slices | ||
| uses: actions/download-artifact@v8 | ||
|
cursor[bot] marked this conversation as resolved.
Outdated
|
||
| with: | ||
| pattern: xcframework-sentry-static-slice-* | ||
| path: xcframework-slices/sentry-static | ||
|
|
||
| - name: Download SentryObjCTypes slices | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| pattern: xcframework-sentryobjc-types-slice-* | ||
| path: xcframework-slices/sentryobjc-types | ||
|
|
||
| - name: Download SentryObjCBridge slices | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| pattern: xcframework-sentryobjc-bridge-slice-* | ||
| path: xcframework-slices/sentryobjc-bridge | ||
|
|
||
| - name: Download SentryObjC slices | ||
| uses: actions/download-artifact@v8 | ||
| with: | ||
| pattern: xcframework-sentryobjc-objc-slice-* | ||
| path: xcframework-slices/sentryobjc-objc | ||
|
|
||
| # Unzip slices into the directory layout expected by | ||
| # build-xcframework-sentryobjc-standalone.sh: | ||
| # XCFrameworkBuildPath/archive/Sentry/{sdk}.xcarchive/... | ||
| # XCFrameworkBuildPath/archive/SentryObjCTypes/{sdk}.xcarchive/... | ||
| # XCFrameworkBuildPath/archive/SentryObjCBridge/{sdk}.xcarchive/... | ||
| # XCFrameworkBuildPath/archive/SentryObjC/{sdk}.xcarchive/... | ||
| - name: Arrange slice archives | ||
| shell: bash | ||
| env: | ||
| SDKS: ${{ inputs.sdks }} | ||
| run: ./scripts/ci-arrange-xcframework-slices.sh --sdks "$SDKS" | ||
|
|
||
| - name: Link and assemble SentryObjC XCFrameworks | ||
| env: | ||
| SDKS: ${{ inputs.sdks }} | ||
| run: ./scripts/build-xcframework-sentryobjc-standalone.sh "$SDKS" | ||
| shell: bash | ||
|
|
||
| - name: Validate XCFramework structure | ||
| run: | | ||
| ./scripts/validate-xcframework-format.sh "SentryObjC-Static.xcframework" | ||
| ./scripts/validate-xcframework-format.sh "SentryObjC-Dynamic.xcframework" | ||
| shell: bash | ||
|
|
||
| - name: Zip XCFrameworks | ||
| env: | ||
| SIGNED: ${{ inputs.signed }} | ||
| run: | | ||
| if [ "$SIGNED" = "true" ]; then | ||
| ./scripts/compress-xcframework.sh --sign SentryObjC-Static | ||
| ./scripts/compress-xcframework.sh --sign SentryObjC-Dynamic | ||
| else | ||
| ./scripts/compress-xcframework.sh --not-signed SentryObjC-Static | ||
| ./scripts/compress-xcframework.sh --not-signed SentryObjC-Dynamic | ||
| fi | ||
| shell: bash | ||
|
|
||
| - name: Upload SentryObjC-Static XCFramework | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| overwrite: true | ||
| name: xcframework-${{github.sha}}-sentryobjc-static | ||
| if-no-files-found: error | ||
| path: SentryObjC-Static.xcframework.zip | ||
|
|
||
| - name: Upload SentryObjC-Dynamic XCFramework | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| overwrite: true | ||
| name: xcframework-${{github.sha}}-sentryobjc-dynamic | ||
| if-no-files-found: error | ||
| path: SentryObjC-Dynamic.xcframework.zip | ||
|
|
||
| - name: Run CI Diagnostics | ||
| if: failure() | ||
| run: ./scripts/ci-diagnostics.sh | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -227,6 +227,45 @@ build-signed-xcframework: | |
| build-xcframework-sample: | ||
| xcodebuild -project "Samples/XCFramework-Validation/XCFramework.xcodeproj" -configuration Release CODE_SIGNING_ALLOWED="NO" build | ||
|
|
||
| ## Build SentryObjC framework for iOS Simulator | ||
| # | ||
| # Builds the SentryObjC framework target for iOS Simulator. | ||
| # This is the Objective-C wrapper framework that provides a stable ABI for ObjC++ consumers. | ||
| # The target must first be added to the Xcode project using: bundle exec ruby scripts/add-sentryobjc-target.rb | ||
| .PHONY: build-sentryobjc | ||
| build-sentryobjc: | ||
| @echo "--> Building SentryObjC for iOS Simulator" | ||
| set -o pipefail && xcodebuild build \ | ||
| -project Sentry.xcodeproj \ | ||
| -scheme SentryObjC \ | ||
| -destination 'platform=iOS Simulator,OS=$(IOS_SIMULATOR_OS),name=$(IOS_DEVICE_NAME)' \ | ||
| -configuration Release \ | ||
| CODE_SIGNING_ALLOWED="NO" 2>&1 | xcbeautify --preserve-unbeautified | ||
|
|
||
| ## Build SentryObjC XCFrameworks locally for one or more SDKs | ||
| # | ||
| # Builds the four staticlib slices (Sentry, SentryObjCTypes, SentryObjCBridge, | ||
| # SentryObjC) and runs the standalone merger to produce SentryObjC-Static and | ||
| # SentryObjC-Dynamic xcframeworks. Output lands in XCFrameworkBuildPath/. | ||
| # | ||
| # SDKS accepts either an SDK preset (iOSOnly, macOSOnly, macCatalystOnly, | ||
| # AllSDKs) or a comma-separated list of SDK names. Required β no default, | ||
| # to keep local iteration fast. | ||
| # | ||
| # Examples: | ||
| # make build-sentryobjc-xcframework-local SDKS=iphonesimulator | ||
| # make build-sentryobjc-xcframework-local SDKS=iphoneos,iphonesimulator | ||
| # make build-sentryobjc-xcframework-local SDKS=iOSOnly | ||
| .PHONY: build-sentryobjc-xcframework-local | ||
| build-sentryobjc-xcframework-local: | ||
| @if [ -z "$(SDKS)" ]; then \ | ||
| echo "error: SDKS is required."; \ | ||
| echo " example: make $@ SDKS=iphonesimulator"; \ | ||
| exit 1; \ | ||
| fi | ||
| @echo "--> Creating SentryObjC xcframeworks (SDKs: $(SDKS))" | ||
| ./scripts/build-xcframework-local.sh "$(SDKS)" SentryObjCOnly | ||
|
|
||
| # ============================================================================ | ||
| # SAMPLE APPS | ||
| # ============================================================================ | ||
|
|
@@ -238,6 +277,7 @@ build-xcframework-sample: | |
| build-samples: \ | ||
| build-sample-DistributionSample \ | ||
| build-sample-iOS-ObjectiveC \ | ||
| build-sample-iOS-ObjectiveCpp-NoModules \ | ||
| build-sample-iOS-Swift \ | ||
| build-sample-iOS-Swift6 \ | ||
| build-sample-iOS-SwiftUI \ | ||
|
|
@@ -332,9 +372,8 @@ build-sample-visionOS-SwiftUI-SPM: | |
|
|
||
| ## Build the iOS-ObjectiveCpp-NoModules sample app | ||
| # | ||
| # Builds the ObjC++ without-modules sample that reproduces #4543. | ||
| # This target is expected to FAIL until the pure ObjC SDK wrapper (#6342) | ||
| # is implemented. Use it to verify the fix. | ||
| # Builds the ObjC++ without-modules sample that uses SentryObjC (#6342). | ||
| # Uses #import <SentryObjC/SentryObjC.h> for ObjC++ without -fmodules. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah an inconsistency. See my other PR feedback comment: Happy to update afterwards |
||
| .PHONY: build-sample-iOS-ObjectiveCpp-NoModules | ||
| build-sample-iOS-ObjectiveCpp-NoModules: | ||
| xcodegen --spec Samples/iOS-ObjectiveCpp-NoModules/iOS-ObjectiveCpp-NoModules.yml | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.