@echo off
echo ========================================
echo SafeCheckIn Minimal Cloud Client Build
echo ========================================
echo.

echo 1. Cleaning previous builds...
call gradlew clean

echo.
echo 2. Building minimal debug APK...
call gradlew assembleDebug

echo.
echo 3. Checking build result...
if exist "app\build\outputs\apk\debug\app-debug.apk" (
    echo.
    echo Build SUCCESSFUL!
    echo.
    echo APK文件: app\build\outputs\apk\debug\app-debug.apk
    echo 文件大小: 
    for %%F in ("app\build\outputs\apk\debug\app-debug.apk") do echo   %%~zF bytes
) else (
    echo.
    echo Build FAILED!
    echo 请查看上面的错误信息
)

echo.
echo ========================================
echo 部署说明:
echo 1. 服务器端: 运行 server\start_cloud.bat
echo 2. 客户端: 安装生成的APK
echo 3. 默认服务器地址: http://localhost:8000
echo ========================================
pause