@@ -5,10 +5,13 @@ cd $(dirname "$0")/../
55config_file=' buildSrc/src/main/java/Config.kt'
66podspec_file=' sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec'
77plugin_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'
810
911config_content=$( cat $config_file )
1012podspec_content=$( cat $podspec_file )
1113plugin_properties_content=$( cat $plugin_properties_file )
14+ sample_podspec_content=$( cat $sample_podspec_file )
1215
1316config_regex=' (sentryCocoaVersion *= *)"([0-9\.]+)"'
1417podspec_regex=" ('Sentry', *)'([0-9\.]+)'"
3942plugin_properties_whole_match=${BASH_REMATCH[0]}
4043plugin_properties_var_name=${BASH_REMATCH[1]}
4144
45+ if ! [[ $sample_podspec_content =~ $podspec_regex ]]; then
46+ echo " Failed to find the Cocoa version in $sample_podspec_file "
47+ exit 1
48+ fi
49+
50+ sample_podspec_whole_match=${BASH_REMATCH[0]}
51+ sample_podspec_var_name=${BASH_REMATCH[1]}
52+
4253case $1 in
4354get-version)
4455 # We only require to return the version number of one of the files
@@ -59,6 +70,14 @@ set-version)
5970 # Update the version in the plugin properties file
6071 newValue=" ${plugin_properties_var_name} $2 "
6172 echo " ${plugin_properties_content/ ${plugin_properties_whole_match} / $newValue } " > $plugin_properties_file
73+
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+ # Run pod update in the sample iOS app directory to update Podfile.lock
79+ echo " Running pod update in $sample_ios_app_dir ..."
80+ (cd $sample_ios_app_dir && pod update)
6281 ;;
6382* )
6483 echo " Unknown argument $1 "
0 commit comments