@echo off
set JAVA_HOME=D:\qclaw file\jdk-17.0.12+7
set ANDROID_HOME=D:\qclaw file\android-sdk
set ANDROID_SDK_ROOT=D:\qclaw file\android-sdk
set PATH=%JAVA_HOME%\bin;%PATH%

cd /d "C:\Users\Administrator\.qclaw\workspace\SafeCheckIn"

echo Cleaning previous build...
call gradlew.bat clean

echo.
echo Building APK...
call gradlew.bat assembleDebug

if %ERRORLEVEL% == 0 (
    echo.
    echo ========================================
    echo Build successful!
    echo APK location: app\build\outputs\apk\debug\app-debug.apk
    echo ========================================
    dir "app\build\outputs\apk\debug\app-debug.apk" /b
) else (
    echo.
    echo ========================================
    echo Build failed. Please check the error messages above.
    echo ========================================
)

pause