mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-05-18 12:19:18 -05:00
94fc19f6f2
- Run app icon and launcher icon generation in build-mobile workflow - Add generate-mobile-icon scripts (Python/Pillow, ImageMagick, Inkscape) - BUILD.md: document icon requirements and troubleshooting - setup.py: version 4.16.0 Co-authored-by: Cursor <cursoragent@cursor.com>
98 lines
2.0 KiB
Batchfile
98 lines
2.0 KiB
Batchfile
@echo off
|
|
REM Build script for TimeTracker Mobile App (Flutter) - Windows
|
|
|
|
setlocal
|
|
set SCRIPT_DIR=%~dp0
|
|
set PROJECT_ROOT=%SCRIPT_DIR%..
|
|
set MOBILE_DIR=%PROJECT_ROOT%\mobile
|
|
|
|
cd /d "%PROJECT_ROOT%"
|
|
|
|
REM Sync version from setup.py to mobile app
|
|
echo Syncing version from setup.py...
|
|
python "%SCRIPT_DIR%sync-mobile-version.py"
|
|
if errorlevel 1 (
|
|
echo ERROR: Failed to sync version
|
|
exit /b 1
|
|
)
|
|
echo.
|
|
|
|
cd /d "%MOBILE_DIR%"
|
|
|
|
echo Building TimeTracker Mobile App...
|
|
echo.
|
|
|
|
REM Check Flutter
|
|
where flutter >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo ERROR: Flutter is not installed or not in PATH
|
|
exit /b 1
|
|
)
|
|
|
|
flutter --version | findstr /C:"Flutter"
|
|
echo.
|
|
|
|
REM Install dependencies
|
|
echo Installing dependencies...
|
|
call flutter pub get
|
|
if errorlevel 1 (
|
|
echo ERROR: Failed to install dependencies
|
|
exit /b 1
|
|
)
|
|
echo.
|
|
|
|
REM Generate app icons (source PNG then launcher sizes)
|
|
cd /d "%PROJECT_ROOT%"
|
|
call "%SCRIPT_DIR%generate-mobile-icon.bat"
|
|
cd /d "%MOBILE_DIR%"
|
|
echo Generating launcher icons...
|
|
call dart run flutter_launcher_icons
|
|
if errorlevel 1 (
|
|
echo ERROR: Failed to generate launcher icons
|
|
exit /b 1
|
|
)
|
|
echo.
|
|
|
|
REM Analyze
|
|
echo Analyzing code...
|
|
call flutter analyze
|
|
echo.
|
|
|
|
REM Run tests
|
|
echo Running tests...
|
|
call flutter test
|
|
echo.
|
|
|
|
REM Build
|
|
set PLATFORM=%1
|
|
if "%PLATFORM%"=="" set PLATFORM=android
|
|
|
|
if /i "%PLATFORM%"=="android" (
|
|
echo Building Android APK...
|
|
call flutter build apk --release
|
|
if errorlevel 1 (
|
|
echo ERROR: Android APK build failed
|
|
exit /b 1
|
|
)
|
|
echo.
|
|
echo Building Android App Bundle...
|
|
call flutter build appbundle --release
|
|
if errorlevel 1 (
|
|
echo ERROR: Android App Bundle build failed
|
|
exit /b 1
|
|
)
|
|
) else if /i "%PLATFORM%"=="all" (
|
|
echo Building Android APK...
|
|
call flutter build apk --release
|
|
echo Building Android App Bundle...
|
|
call flutter build appbundle --release
|
|
) else (
|
|
echo Usage: %0 [android^|all]
|
|
exit /b 1
|
|
)
|
|
|
|
echo.
|
|
echo Build complete!
|
|
echo Outputs: %MOBILE_DIR%\build\
|
|
endlocal
|