Skip to content

Commit c40707e

Browse files
authored
feat(gh-action): update gradle plugin cocoa version (#260)
* update * dont merge * change name of folder * dont merge * update
1 parent 2b287dd commit c40707e

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

scripts/update-cocoa.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ cd $(dirname "$0")/../
44

55
config_file='buildSrc/src/main/java/Config.kt'
66
podspec_file='sentry-kotlin-multiplatform/sentry_kotlin_multiplatform.podspec'
7+
plugin_properties_file='sentry-kotlin-multiplatform-gradle-plugin/gradle.properties'
78

89
config_content=$(cat $config_file)
910
podspec_content=$(cat $podspec_file)
11+
plugin_properties_content=$(cat $plugin_properties_file)
1012

1113
config_regex='(sentryCocoaVersion *= *)"([0-9\.]+)"'
1214
podspec_regex="('Sentry', *)'([0-9\.]+)'"
15+
plugin_properties_regex='(sentryCocoaVersion *= *)([0-9\.]+)'
1316

1417
if ! [[ $config_content =~ $config_regex ]]; then
1518
echo "Failed to find the Cocoa version in $config_file"
@@ -28,6 +31,14 @@ fi
2831
podspec_whole_match=${BASH_REMATCH[0]}
2932
podspec_var_name=${BASH_REMATCH[1]}
3033

34+
if ! [[ $plugin_properties_content =~ $plugin_properties_regex ]]; then
35+
echo "Failed to find the Cocoa version in $plugin_properties_file"
36+
exit 1
37+
fi
38+
39+
plugin_properties_whole_match=${BASH_REMATCH[0]}
40+
plugin_properties_var_name=${BASH_REMATCH[1]}
41+
3142
case $1 in
3243
get-version)
3344
# We only require to return the version number of one of the files
@@ -44,6 +55,10 @@ set-version)
4455
# Update the version in the podspec file
4556
newValue="${podspec_var_name}'$2'"
4657
echo "${podspec_content/${podspec_whole_match}/$newValue}" >$podspec_file
58+
59+
# Update the version in the plugin properties file
60+
newValue="${plugin_properties_var_name}$2"
61+
echo "${plugin_properties_content/${plugin_properties_whole_match}/$newValue}" >$plugin_properties_file
4762
;;
4863
*)
4964
echo "Unknown argument $1"

sentry-kotlin-multiplatform-gradle-plugin/gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ id=io.sentry.kotlin.multiplatform.gradle
22
implementationClass=io.sentry.kotlin.multiplatform.gradle.SentryPlugin
33
versionName=0.8.0
44
group=io.sentry
5-
# TODO: Update update-cocoa.sh so the cocoa version is auto updated as well
65
sentryCocoaVersion=8.26.0
76

87
# publication pom properties

0 commit comments

Comments
 (0)