Skip to content
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

feat(gh-action): update gradle plugin cocoa version #260

Merged
merged 5 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions scripts/update-cocoa.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ cd $(dirname "$0")/../

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

config_content=$(cat $config_file)
podspec_content=$(cat $podspec_file)
plugin_properties_content=$(cat $plugin_properties_file)

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

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

if ! [[ $plugin_properties_content =~ $plugin_properties_regex ]]; then
echo "Failed to find the Cocoa version in $plugin_properties_file"
exit 1
fi

plugin_properties_whole_match=${BASH_REMATCH[0]}
plugin_properties_var_name=${BASH_REMATCH[1]}

case $1 in
get-version)
# We only require to return the version number of one of the files
Expand All @@ -44,6 +55,10 @@ set-version)
# Update the version in the podspec file
newValue="${podspec_var_name}'$2'"
echo "${podspec_content/${podspec_whole_match}/$newValue}" >$podspec_file

# Update the version in the plugin properties file
newValue="${plugin_properties_var_name}$2"
echo "${plugin_properties_content/${plugin_properties_whole_match}/$newValue}" >$plugin_properties_file
;;
*)
echo "Unknown argument $1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ id=io.sentry.kotlin.multiplatform.gradle
implementationClass=io.sentry.kotlin.multiplatform.gradle.SentryPlugin
versionName=0.8.0
group=io.sentry
# TODO: Update update-cocoa.sh so the cocoa version is auto updated as well
sentryCocoaVersion=8.26.0

# publication pom properties
Expand Down
Loading