Skip to content

Commit a3604ca

Browse files
committed
Run tasks separately when generating lockfile
1 parent 8b90a62 commit a3604ca

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

android/scripts/update-lockfile.sh

+9-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ 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+
# Task list to discover all tasks and their dependencies since
15+
# just running the suggested 'help' task isn't sufficient.
1416
GRADLE_TASKS=(
1517
"assemble"
1618
"compileDebugUnitTestKotlin"
@@ -35,6 +37,12 @@ echo ""
3537

3638
echo "Removing old components..."
3739
sed -i '/<components>/,/<\/components>/d' ../gradle/verification-metadata.xml
40+
echo ""
3841

3942
echo "Generating new components..."
40-
../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)