Skip to content

Commit 7e84b40

Browse files
buenaflorclaudecursoragent
committed
chore: make SPM the only Apple sample and remove cocoapods tooling
Phase 2 of the spm4Kmp migration. The SDK no longer uses the Kotlin CocoaPods plugin, so the CocoaPods sample and the internal CocoaPods build tooling are now dead and the SPM sample becomes the sole Apple sample. - Makefile buildAppleSamples now xcodebuilds the SPM sample (kmp-app-spm/iosApp.xcodeproj) and drops podInstall/pod update; CI inherits this via `make buildAppleSamples` - Remove the kmp-app-cocoapods sample (settings include, .run configs) and repoint kmp-app-spm:desktopApp to the SPM shared module - Delete the SDK sentry_kotlin_multiplatform.podspec and the now-unused native.cocoapods plugin entry (root build.gradle.kts + Config.cocoapods) - Rewrite scripts/update-cocoa.sh to bump Config.kt, the plugin gradle.properties, and the SPM sample SwiftPM pin (project.pbxproj), then refresh Package.resolved via xcodebuild -resolvePackageDependencies - Point scripts/bump-version.sh at Config.kt for the Cocoa compat version (podspec is gone) and narrow the sample prepare scripts to kmp-app-spm Consumer-facing Gradle plugin CocoaPods support (installSentryForCocoapods, CocoapodsAutoInstallExtension, CocoaFrameworkLinker) is untouched. Verified: SPM sample iOS xcodebuild BUILD SUCCEEDED, ./gradlew build -p sentry-samples, spotless/detekt/apiCheck green, update-cocoa.sh get-version. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent f7815e2 commit 7e84b40

50 files changed

Lines changed: 34 additions & 1633 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.run/androidApp-cocoapods.run.xml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.run/iosApp-cocoapods.run.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,9 @@ buildProject:
3838
# Build Apple Samples
3939
buildAppleSamples:
4040
./gradlew build -p sentry-samples
41-
cd ./sentry-samples/kmp-app-cocoapods/iosApp/iosApp && touch iosApp.xcconfig
42-
# cd ./sentry-samples/kmp-app-mvvm-di/iosApp && touch iosApp.xcconfig
41+
cd ./sentry-samples/kmp-app-spm/iosApp && touch iosApp.xcconfig
4342
sudo xcode-select --switch /Applications/Xcode.app && /usr/bin/xcodebuild -version
44-
./gradlew ":sentry-samples:kmp-app-cocoapods:shared:podInstall"
45-
cd ./sentry-samples/kmp-app-cocoapods/iosApp; pod update;
46-
xcodebuild -workspace ./sentry-samples/kmp-app-cocoapods/iosApp/iosApp.xcworkspace -scheme iosApp -configuration Debug -sdk iphonesimulator -arch arm64
47-
# xcodebuild -project ./sentry-samples/kmp-app-mvvm-di/iosApp.xcodeproj -scheme iosApp -configuration Debug -sdk iphonesimulator -arch arm64
43+
xcodebuild -project ./sentry-samples/kmp-app-spm/iosApp.xcodeproj -scheme iosApp -configuration Debug -sdk iphonesimulator -arch arm64
4844

4945

5046
# Build all targets, run tests and checks api

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ plugins {
1010
id(Config.QualityPlugins.detekt).version(Config.QualityPlugins.detektVersion)
1111
id(Config.dokka).version(Config.dokkaVersion)
1212
kotlin(Config.multiplatform).version(Config.kotlinVersion).apply(false)
13-
kotlin(Config.cocoapods).version(Config.kotlinVersion).apply(false)
1413
id(Config.spmForKmp).version(Config.spmForKmpVersion).apply(false)
1514
id(Config.jetpackCompose).version(Config.composePluginVersion).apply(false)
1615
id(Config.kotlinCompose).version(Config.kotlinVersion).apply(false)

buildSrc/src/main/java/Config.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ object Config {
55
val gradleMavenPublishPluginVersion = "0.30.0"
66

77
val multiplatform = "multiplatform"
8-
val cocoapods = "native.cocoapods"
98
val spmForKmp = "io.github.frankois944.spmForKmp"
109
val spmForKmpVersion = "1.9.3"
1110
val jetpackCompose = "org.jetbrains.compose"

scripts/bump-version.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,17 @@ VERSION_NAME_PATTERN="versionName"
1919
perl -pi -e "s/$VERSION_NAME_PATTERN=.*$/$VERSION_NAME_PATTERN=$NEW_VERSION/g" $GRADLE_FILEPATH
2020
perl -pi -e "s/$VERSION_NAME_PATTERN=.*$/$VERSION_NAME_PATTERN=$NEW_VERSION/g" $PLUGIN_GRADLE_FILEPATH
2121

22-
PODSPEC_FILEPATH='sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec'
23-
PODSPEC_CONTENT=$(cat $PODSPEC_FILEPATH)
22+
CONFIG_FILEPATH='buildSrc/src/main/java/Config.kt'
23+
CONFIG_CONTENT=$(cat $CONFIG_FILEPATH)
2424

25-
PODSPEC_REGEX="('Sentry', *)'([0-9\.]+)'"
25+
COCOA_VERSION_REGEX='sentryCocoaVersion *= *"([0-9\.]+)"'
2626

27-
if ! [[ $PODSPEC_CONTENT =~ $PODSPEC_REGEX ]]; then
28-
echo "Failed to find the Cocoa version in $PODSPEC_FILEPATH"
27+
if ! [[ $CONFIG_CONTENT =~ $COCOA_VERSION_REGEX ]]; then
28+
echo "Failed to find the Cocoa version in $CONFIG_FILEPATH"
2929
exit 1
3030
fi
3131

32-
PODSPEC_WHOLE_MATCH=${BASH_REMATCH[0]}
33-
PODSPEC_VAR_NAME=${BASH_REMATCH[1]}
34-
PODSPEC_VERSION=${BASH_REMATCH[2]}
32+
PODSPEC_VERSION=${BASH_REMATCH[1]}
3533

3634
# create a new table entry in readme with NEW_VERSION and PODSPEC_VERSION in the compatibility table
3735
# Find the line number of the last entry in the compatibility table and insert the new entry after it

scripts/update-cocoa.sh

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
cd $(dirname "$0")/../
44

55
config_file='buildSrc/src/main/java/Config.kt'
6-
podspec_file='sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec'
76
plugin_properties_file='sentry-kotlin-multiplatform-gradle-plugin/gradle.properties'
8-
sample_podspec_file='sentry-samples/kmp-app-cocoapods/shared/shared.podspec'
9-
sample_ios_app_dir='sentry-samples/kmp-app-cocoapods/iosApp'
7+
spm_sample_pbxproj_file='sentry-samples/kmp-app-spm/iosApp.xcodeproj/project.pbxproj'
8+
spm_sample_project='sentry-samples/kmp-app-spm/iosApp.xcodeproj'
9+
spm_sample_scheme='iosApp'
1010

1111
config_content=$(cat $config_file)
12-
podspec_content=$(cat $podspec_file)
1312
plugin_properties_content=$(cat $plugin_properties_file)
14-
sample_podspec_content=$(cat $sample_podspec_file)
13+
pbxproj_content=$(cat $spm_sample_pbxproj_file)
1514

1615
config_regex='(sentryCocoaVersion *= *)"([0-9\.]+)"'
17-
podspec_regex="('Sentry', *)'([0-9\.]+)'"
1816
plugin_properties_regex='(sentryCocoaVersion *= *)([0-9\.]+)'
17+
# Matches the sentry-cocoa SwiftPM pin in the SPM sample, e.g. `version = 8.58.2;`
18+
pbxproj_regex='(version = )([0-9\.]+)(;)'
1919

2020
if ! [[ $config_content =~ $config_regex ]]; then
2121
echo "Failed to find the Cocoa version in $config_file"
@@ -26,14 +26,6 @@ config_whole_match=${BASH_REMATCH[0]}
2626
config_var_name=${BASH_REMATCH[1]}
2727
config_version=${BASH_REMATCH[2]}
2828

29-
if ! [[ $podspec_content =~ $podspec_regex ]]; then
30-
echo "Failed to find the Cocoa version in $podspec_file"
31-
exit 1
32-
fi
33-
34-
podspec_whole_match=${BASH_REMATCH[0]}
35-
podspec_var_name=${BASH_REMATCH[1]}
36-
3729
if ! [[ $plugin_properties_content =~ $plugin_properties_regex ]]; then
3830
echo "Failed to find the Cocoa version in $plugin_properties_file"
3931
exit 1
@@ -42,13 +34,12 @@ fi
4234
plugin_properties_whole_match=${BASH_REMATCH[0]}
4335
plugin_properties_var_name=${BASH_REMATCH[1]}
4436

45-
if ! [[ $sample_podspec_content =~ $podspec_regex ]]; then
46-
echo "Failed to find the Cocoa version in $sample_podspec_file"
37+
if ! [[ $pbxproj_content =~ $pbxproj_regex ]]; then
38+
echo "Failed to find the sentry-cocoa SwiftPM version in $spm_sample_pbxproj_file"
4739
exit 1
4840
fi
4941

50-
sample_podspec_whole_match=${BASH_REMATCH[0]}
51-
sample_podspec_var_name=${BASH_REMATCH[1]}
42+
pbxproj_whole_match=${BASH_REMATCH[0]}
5243

5344
case $1 in
5445
get-version)
@@ -63,28 +54,21 @@ set-version)
6354
newValue="${config_var_name}\"$2"\"
6455
echo "${config_content/${config_whole_match}/$newValue}" >$config_file
6556

66-
# Update the version in the podspec file
67-
newValue="${podspec_var_name}'$2'"
68-
echo "${podspec_content/${podspec_whole_match}/$newValue}" >$podspec_file
69-
7057
# Update the version in the plugin properties file
7158
newValue="${plugin_properties_var_name}$2"
7259
echo "${plugin_properties_content/${plugin_properties_whole_match}/$newValue}" >$plugin_properties_file
7360

74-
# Update the version in the sample podspec file
75-
newValue="${sample_podspec_var_name}'$2'"
76-
echo "${sample_podspec_content/${sample_podspec_whole_match}/$newValue}" >$sample_podspec_file
77-
78-
# Generate dummy framework first (required for pod update to work)
79-
echo "Generating dummy framework for shared module..."
80-
./gradlew :sentry-samples:kmp-app-cocoapods:shared:generateDummyFramework
61+
# Update the sentry-cocoa SwiftPM pin in the SPM sample Xcode project
62+
newValue="version = $2;"
63+
echo "${pbxproj_content/${pbxproj_whole_match}/$newValue}" >$spm_sample_pbxproj_file
8164

82-
# Run pod update in the sample iOS app directory to update Podfile.lock
83-
echo "Running pod update in $sample_ios_app_dir..."
84-
(cd $sample_ios_app_dir && pod update)
65+
# Refresh the SPM sample lockfiles (Package.resolved) so the pinned revision
66+
# matches the new version.
67+
echo "Resolving SwiftPM dependencies for the SPM sample..."
68+
xcodebuild -resolvePackageDependencies -project $spm_sample_project -scheme $spm_sample_scheme
8569
;;
8670
*)
8771
echo "Unknown argument $1"
8872
exit 1
8973
;;
90-
esac
74+
esac

sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec

Lines changed: 0 additions & 57 deletions
This file was deleted.

sentry-samples/kmp-app-cocoapods/androidApp/build.gradle.kts

Lines changed: 0 additions & 73 deletions
This file was deleted.
-2.61 KB
Binary file not shown.

0 commit comments

Comments
 (0)