This document explains how version syncing and build configuration works across all TimeTracker applications.
All applications now sync their version from setup.py, which is the single source of truth for version information.
Version Sync:
- Automatically syncs from
setup.pytodesktop/package.jsonbefore building - Script:
scripts/sync-desktop-version.py - Run manually:
python scripts/sync-desktop-version.py
Build Scripts:
scripts/build-desktop.bat(Windows)scripts/build-desktop.sh(Linux/macOS)scripts/build-all.bat/scripts/build-all.sh
All build scripts automatically sync the version before building.
Version Sync:
- Automatically syncs from
setup.pyto:mobile/pubspec.yaml(Flutter version)mobile/android/local.properties(Android version code and name)
- Script:
scripts/sync-mobile-version.py - Run manually:
python scripts/sync-mobile-version.py
Version Code Calculation:
- Android version code is calculated as:
major * 10000 + minor * 100 + patch - Example: Version
5.5.6→ version code50506
Build Scripts:
scripts/build-mobile.bat(Windows)scripts/build-mobile.sh(Linux/macOS)scripts/build-all.bat/scripts/build-all.sh
All build scripts automatically sync the version before building.
The desktop app can receive the server URL in multiple ways:
-
Command Line Argument:
TimeTracker.exe --server-url https://your-server.com # or TimeTracker.exe --server https://your-server.com -
Environment Variable:
set TIMETRACKER_SERVER_URL=https://your-server.com TimeTracker.exe -
In-App Configuration:
- Users can configure the server URL in the app's settings screen
- Stored in Electron's secure storage
The mobile app supports server URL configuration through:
-
Environment Variable (Build Time):
flutter build apk --dart-define=TIMETRACKER_SERVER_URL=https://your-server.com
-
Default Server URL (Build Time):
flutter build apk --dart-define=DEFAULT_SERVER_URL=https://your-server.com
-
Runtime Configuration:
- Users can configure the server URL in the app settings
- Stored in SharedPreferences
- Configuration class:
mobile/lib/core/config/app_config.dart
Required Files:
desktop/assets/icon.ico- Windows icondesktop/assets/icon.icns- macOS icondesktop/assets/icon.png- Linux icon
Generation:
See desktop/assets/README.md for detailed instructions on generating icons from the SVG logo.
Favicon:
- Configured in
desktop/src/renderer/index.html - Uses
desktop/assets/icon.pngandicon.ico - Falls back gracefully if files don't exist
The web application uses the logo as favicon:
- Location:
app/static/images/timetracker-logo.svg - Configured in:
app/templates/base.html - Also used in PWA manifest:
app/static/manifest.json(seescripts/generate_pwa_icons.pyfor install icons)
The Electron build is optimized for smaller executables:
- ASAR Packaging: Enabled (
"asar": true) - Compression: Maximum (
"compression": "maximum") - Architecture: Only x64 (removed ia32 for smaller size)
- NSIS Compressor: zlib for better compression
Executables are named with version information:
- Windows:
TimeTracker-4.10.1-x64.exe - macOS:
TimeTracker-4.10.1-x64.dmgorTimeTracker-4.10.1-arm64.dmg - Linux:
TimeTracker-4.10.1-x64.AppImageorTimeTracker-4.10.1-x64.deb
# Windows
scripts\build-desktop.bat
# Linux/macOS
./scripts/build-desktop.sh
# All platforms (on macOS)
./scripts/build-desktop.sh all# Windows
scripts\build-mobile.bat
# Linux/macOS
./scripts/build-mobile.sh
# With custom server URL
flutter build apk --dart-define=TIMETRACKER_SERVER_URL=https://your-server.com# Windows
scripts\build-all.bat
# Linux/macOS
./scripts/build-all.sh# Windows
TimeTracker.exe --server-url https://your-server.com
# Linux/macOS
./TimeTracker --server-url https://your-server.com
# Or with environment variable
export TIMETRACKER_SERVER_URL=https://your-server.com
./TimeTrackerTo update the version for all applications:
-
Update
setup.py:setup( name='timetracker', version='5.12.0', # Update here ... )
-
Run version sync scripts:
python scripts/sync-desktop-version.py python scripts/sync-mobile-version.py
-
Or just build - the build scripts will automatically sync versions
- Ensure Python 3 is installed and in PATH
- Check that
setup.pyexists in the project root - Verify the version format in
setup.pymatches semantic versioning (X.Y.Z)
- Ensure icon files exist in
desktop/assets/ - Check file permissions
- Verify icon file formats are correct (.ico for Windows, .icns for macOS, .png for Linux)
- Verify the URL format (must start with http:// or https://)
- Check command line argument syntax
- Ensure environment variables are set correctly
- For mobile app, verify the configuration class is imported correctly