Skip to content

Commit

Permalink
Run tasks separately when generating lockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
albin-mullvad committed Aug 15, 2024
1 parent 8b90a62 commit a3604ca
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion android/scripts/update-lockfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ GRADLE_OPTS="-Dorg.gradle.daemon=false"
# We must provide a template for mktemp to work properly on macOS.
GRADLE_USER_HOME=$(mktemp -d -t gradle-home-XXX)
TEMP_GRADLE_PROJECT_CACHE_DIR=$(mktemp -d -t gradle-cache-XXX)
# Task list to discover all tasks and their dependencies since
# just running the suggested 'help' task isn't sufficient.
GRADLE_TASKS=(
"assemble"
"compileDebugUnitTestKotlin"
Expand All @@ -35,6 +37,12 @@ echo ""

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

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

0 comments on commit a3604ca

Please sign in to comment.