Files
Ontime/build-debug-apks.sh
2026-03-11 15:29:37 +07:00

38 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Build debug APKs for OnTime User, Driver, and Merchant apps.
# Requires: JDK 17+, Android SDK (API 33), Gradle (or use wrapper).
# Run from repo root: ./build-debug-apks.sh
set -e
REPO_ROOT="$(cd "$(dirname "$0")" && pwd)"
cd "$REPO_ROOT"
# Merchant uses same keystore as User; copy if missing
KEYSTORE_SRC="$REPO_ROOT/OnTime_User_live/app/ontimekeystore.jks"
KEYSTORE_MERCHANT="$REPO_ROOT/OnTime_Merchant_live/app/ontimekeystore.jks"
if [ -f "$KEYSTORE_SRC" ] && [ ! -f "$KEYSTORE_MERCHANT" ]; then
echo "Copying keystore to Merchant app..."
cp "$KEYSTORE_SRC" "$KEYSTORE_MERCHANT"
fi
echo "=== Building OnTime User (debug) ==="
cd OnTime_User_live
./gradlew assembleDebug --no-daemon
cd "$REPO_ROOT"
echo "=== Building OnTime Driver (debug) ==="
cd OnTime_Driver_live
./gradlew assembleDebug --no-daemon
cd "$REPO_ROOT"
echo "=== Building OnTime Merchant (debug) ==="
cd OnTime_Merchant_live
./gradlew assembleDebug --no-daemon
cd "$REPO_ROOT"
echo ""
echo "=== Debug APKs built ==="
echo "User: $REPO_ROOT/OnTime_User_live/app/build/outputs/apk/debug/app-debug.apk"
echo "Driver: $REPO_ROOT/OnTime_Driver_live/app/build/outputs/apk/debug/app-debug.apk"
echo "Merchant: $REPO_ROOT/OnTime_Merchant_live/app/build/outputs/apk/debug/app-debug.apk"