Files
Termux-Android-Builder/lib/commands/build.sh
T
2026-07-02 04:39:33 +01:00

25 lines
503 B
Bash
Executable File

#!/data/data/com.termux/files/usr/bin/bash
set -e
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
source "$ROOT_DIR/lib/common.sh"
test -f local.properties || echo "sdk.dir=$SDK" > local.properties
BUILD_TYPE="$(get_build_type)"
case "$BUILD_TYPE" in
debug) TASK="assembleDebug" ;;
release) TASK="assembleRelease" ;;
*)
echo "Unknown build type: $BUILD_TYPE"
exit 1
;;
esac
if [ -f ./gradlew ]; then
chmod +x ./gradlew
./gradlew "$TASK"
else
gradle "$TASK"
fi