Refactor android-builder into command scripts

This commit is contained in:
Dark98
2026-07-02 04:39:33 +01:00
parent 7c32d315db
commit 0c3249fa4b
9 changed files with 438 additions and 370 deletions
+24
View File
@@ -0,0 +1,24 @@
#!/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