Files
kvitt/tools/gradle-serial.sh
T

13 lines
833 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# Runs ./gradlew with the given arguments, one Gradle build at a time across every worktree and agent on this machine
# (CLAUDE.md › Build and verify: parallel builds exhaust memory). Waits for a running build to finish, then runs.
# The Gradle project lives in android/; the wrapper there is used whatever directory this is started from.
# Usage from any directory of a checkout or worktree: tools/gradle-serial.sh check (or ../tools/gradle-serial.sh from android/)
# shellcheck source-path=SCRIPTDIR source=gradle-lock.sh
. "$(dirname "$0")/gradle-lock.sh"
top=$(git rev-parse --show-toplevel) || exit 1
[ -x "$top/android/gradlew" ] || { echo "gradle-serial: no android/gradlew in $top yet" >&2; exit 1; }
gradle_lock_acquire
trap 'rm -rf "$KVITT_GRADLE_LOCK"' EXIT INT TERM HUP
cd "$top/android" && ./gradlew "$@"