Skip to content

Commit 89837d1

Browse files
committedAug 15, 2024
Refactor lockfile task execution
1 parent 3ed7758 commit 89837d1

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed
 

‎android/scripts/update-lockfile.sh

+15-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ GRADLE_OPTS="-Dorg.gradle.daemon=false"
1111
# We must provide a template for mktemp to work properly on macOS.
1212
GRADLE_USER_HOME=$(mktemp -d -t gradle-home-XXX)
1313
TEMP_GRADLE_PROJECT_CACHE_DIR=$(mktemp -d -t gradle-cache-XXX)
14-
GRADLE_TASKS=("assemble" "compileDebugUnitTestKotlin" "assembleAndroidTest" "lint")
14+
# Task list to discover all tasks and their dependencies since
15+
# just running the suggested 'help' task isn't sufficient.
16+
GRADLE_TASKS=(
17+
"assemble"
18+
"compileDebugUnitTestKotlin"
19+
"assembleAndroidTest"
20+
"lint"
21+
)
1522

1623
export GRADLE_OPTS
1724
export GRADLE_USER_HOME
@@ -30,6 +37,12 @@ echo ""
3037

3138
echo "Removing old components..."
3239
sed -i '/<components>/,/<\/components>/d' ../gradle/verification-metadata.xml
40+
echo ""
3341

3442
echo "Generating new components..."
35-
../gradlew -q -p .. --project-cache-dir "$TEMP_GRADLE_PROJECT_CACHE_DIR" -M sha256 "${GRADLE_TASKS[@]}"
43+
# Using a loop here since providing all tasks at once result in gradle task dependency issues.
44+
for GRADLE_TASK in "${GRADLE_TASKS[@]}"; do
45+
echo "Gradle task: $GRADLE_TASK"
46+
../gradlew -q -p .. --project-cache-dir "$TEMP_GRADLE_PROJECT_CACHE_DIR" -M sha256 "$GRADLE_TASK"
47+
echo ""
48+
done

0 commit comments

Comments
 (0)