Skip to content

Commit 0dd7283

Browse files
authored
Update API file to be v9 only (#6314)
1 parent 07f6759 commit 0dd7283

File tree

4 files changed

+18
-62750
lines changed

4 files changed

+18
-62750
lines changed

.github/workflows/api-stability.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ jobs:
3838
if: needs.files-changed.outputs.run_api_stability_for_prs == 'true'
3939
needs: files-changed
4040
runs-on: macos-15
41-
strategy:
42-
matrix:
43-
version: [default, v9]
4441
steps:
4542
- name: Checkout code
4643
uses: actions/checkout@v5
@@ -49,21 +46,16 @@ jobs:
4946

5047
- name: Generate HEAD SDK
5148
run: |
52-
if [ "${{ matrix.version }}" = "v9" ]; then
53-
mv sdk_api_v9.json sdk_api_base.json
54-
./scripts/update-api.sh V9
55-
mv sdk_api_v9.json sdk_api.json
56-
else
57-
mv sdk_api.json sdk_api_base.json
58-
./scripts/update-api.sh
59-
fi
49+
mv sdk_api_V9.json sdk_api_base.json
50+
./scripts/update-api.sh V9
51+
mv sdk_api_V9.json sdk_api.json
6052
6153
- name: Diagnose breaking changes
6254
run: |
6355
if diff -q "sdk_api_base.json" "sdk_api.json" > /dev/null; then
64-
echo "No API changes detected for ${{ matrix.version }} version."
56+
echo "No API changes detected."
6557
else
66-
echo "❌ Public API changes are detected for ${{ matrix.version }} version. If they're intended run "make generate-public-api" and commit the changes."
58+
echo "❌ Public API changes are detected. If they're intended run "make generate-public-api" and commit the changes."
6759
diff "sdk_api_base.json" "sdk_api.json" || true
6860
xcrun --sdk iphoneos swift-api-digester \
6961
-diagnose-sdk \

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ format-yaml:
8888

8989
generate-public-api:
9090
./scripts/update-api.sh
91-
./scripts/update-api.sh V9
9291

9392
## Current git reference name
9493
GIT-REF := $(shell git rev-parse --abbrev-ref HEAD)

scripts/update-api.sh

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
11
#!/bin/bash
22
set -euo pipefail
33

4-
configuration_suffix="${1-}"
5-
6-
./scripts/build-xcframework-slice.sh "iphoneos" "Sentry" "-Dynamic" "mh_dylib" "$configuration_suffix"
4+
./scripts/build-xcframework-slice.sh "iphoneos" "Sentry" "-Dynamic" "mh_dylib" "V9"
75

86
./scripts/assemble-xcframework.sh "Sentry" "-Dynamic" "" "iphoneos" "$(pwd)/Carthage/archive/Sentry-Dynamic/SDK_NAME.xcarchive"
97

108
# Delete private .swiftinterface files before running swift-api-digester
119
# This ensures only public interfaces are analyzed
1210
find ./Sentry-Dynamic.xcframework -name "*.private.swiftinterface" -type f -delete
1311

14-
if [ "$configuration_suffix" = "V9" ]; then
15-
FWROOT="./Sentry-Dynamic.xcframework/ios-arm64_arm64e/Sentry.framework"
16-
for FRAME in Headers PrivateHeaders; do
17-
HDRDIR="$FWROOT/${FRAME}"
18-
for H in "$HDRDIR"/*.h; do
19-
# unifdef will:
20-
# - keep code under #if SDK_V9 (because of -D)
21-
# - remove code under #else
22-
# - strip away the #if/#else/#endif lines themselves
23-
unifdef -D SDK_V9 -x 2 "$H" > "$H.tmp"
24-
mv "$H.tmp" "$H"
25-
done
12+
FWROOT="./Sentry-Dynamic.xcframework/ios-arm64_arm64e/Sentry.framework"
13+
for FRAME in Headers PrivateHeaders; do
14+
HDRDIR="$FWROOT/${FRAME}"
15+
for H in "$HDRDIR"/*.h; do
16+
# unifdef will:
17+
# - keep code under #if SDK_V9 (because of -D)
18+
# - remove code under #else
19+
# - strip away the #if/#else/#endif lines themselves
20+
unifdef -D SDK_V9 -x 2 "$H" > "$H.tmp"
21+
mv "$H.tmp" "$H"
2622
done
27-
fi
23+
done
2824

2925
xcrun --sdk iphoneos swift-api-digester \
3026
-dump-sdk \
31-
-o sdk_api${configuration_suffix:+"_${configuration_suffix}"}.json \
27+
-o sdk_api_v9.json \
3228
-abort-on-module-fail \
3329
-avoid-tool-args \
3430
-avoid-location \

0 commit comments

Comments
 (0)