-
-
Notifications
You must be signed in to change notification settings - Fork 360
Expand file tree
/
Copy pathupdate-android.sh
More file actions
executable file
·33 lines (31 loc) · 861 Bytes
/
update-android.sh
File metadata and controls
executable file
·33 lines (31 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
set -euo pipefail
cd $(dirname "$0")/../packages/core/android
file='build.gradle'
content=$(cat $file)
regex='(io\.sentry:sentry-android:)([0-9\.]+)'
if ! [[ $content =~ $regex ]]; then
echo "Failed to find the android plugin version in $file"
exit 1
fi
case $1 in
get-version)
echo ${BASH_REMATCH[2]}
;;
get-repo)
echo "https://github.com/getsentry/sentry-java.git"
;;
set-version)
# Update all io.sentry dependencies to the same version
newContent="$content"
# Update sentry-android
newContent=$(echo "$newContent" | sed -E "s/(io\.sentry:sentry-android:)([0-9\.]+)/\1$2/g")
# Update sentry-spotlight
newContent=$(echo "$newContent" | sed -E "s/(io\.sentry:sentry-spotlight:)([0-9\.]+)/\1$2/g")
echo "$newContent" >$file
;;
*)
echo "Unknown argument $1"
exit 1
;;
esac