Skip to content

Commit ee163ea

Browse files
authored
Add accompanist to the upgrade script (#816)
1 parent f2b4a74 commit ee163ea

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

scripts/upgrade_samples.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ read spotless_version;
4545
echo "Version to change ktlint to (e.g 0.45.2): ";
4646
read ktlint_version;
4747

48+
echo "Version to change Accompanist to (e.g 0.24.9-beta): ";
49+
read accompanist_version;
50+
4851
if [ -z "$snapshot_version" ]; then
4952
echo "Changing Compose version to $compose_version"
5053
else
@@ -54,6 +57,7 @@ fi
5457
# Change Dependencies.kt versions
5558
for DEPENDENCIES_FILE in `find . -type f -iname "dependencies.kt"` ; do
5659
COMPOSE_BLOCK=false;
60+
ACCOMPANIST_BLOCK=false;
5761
MADE_CHANGE=false;
5862
TEMP_FILENAME="${DEPENDENCIES_FILE}_new";
5963
while IFS= read -r line; do
@@ -63,14 +67,20 @@ for DEPENDENCIES_FILE in `find . -type f -iname "dependencies.kt"` ; do
6367
elif [[ $line == *"val snapshot ="* && "$snapshot_version" != "" ]] && $COMPOSE_BLOCK = true; then
6468
echo "$line" | sed -En 's/".*"/"'$snapshot_version'"/p'
6569
MADE_CHANGE=true;
70+
elif [[ $line == *"val version ="* && "$accompanist_version" != "" ]] && $ACCOMPANIST_BLOCK = true; then
71+
echo "$line" | sed -En 's/".*"/"'$accompanist_version'"/p'
72+
MADE_CHANGE=true;
6673
elif [[ $line == *"val ktlint ="* && "$ktlint_version" != "" ]]; then
6774
echo "$line" | sed -En 's/".*"/"'$ktlint_version'"/p'
6875
MADE_CHANGE=true;
6976
else
7077
if [[ $line == *"object Compose {"* ]]; then
7178
COMPOSE_BLOCK=true;
79+
elif [[ $line == *"object Accompanist {"* ]]; then
80+
ACCOMPANIST_BLOCK=true;
7281
elif [[ $line == *"}"* ]]; then
7382
COMPOSE_BLOCK=false;
83+
ACCOMPANIST_BLOCK=false;
7484
fi
7585
echo "$line";
7686
fi
@@ -95,6 +105,9 @@ for DEPENDENCIES_FILE in `find . -type f -iname "build.gradle"` ; do
95105
elif [[ $line == *"ext.compose_snapshot_version ="* && "$snapshot_version" != "" ]]; then
96106
echo "$line" | sed -En "s/\'.*'/\'$snapshot_version\'/p"
97107
MADE_CHANGE=true;
108+
elif [[ $line == *"ext.accompanist_version ="* && "$accompanist_version" != "" ]]; then
109+
echo "$line" | sed -En "s/\'.*'/\'$accompanist_version\'/p"
110+
MADE_CHANGE=true;
98111
elif [[ $line == *"'com.diffplug.spotless' version"* && "$spotless_version" != "" ]]; then
99112
echo "$line" | sed -En "s/\'.*'/\'com.diffplug.spotless\' version \'$spotless_version\'/p"
100113
MADE_CHANGE=true;

0 commit comments

Comments
 (0)