2026-04-16 07:40:34 +02:00
|
|
|
version: "3"
|
2026-04-16 11:48:37 +02:00
|
|
|
silent: true
|
2026-04-16 07:40:34 +02:00
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
default:
|
2026-04-16 15:14:18 +02:00
|
|
|
desc: Run all checks (analyze + unit tests + widget tests + integration, in parallel)
|
2026-04-16 07:40:34 +02:00
|
|
|
deps: [check]
|
|
|
|
|
|
|
|
|
|
_nix-check:
|
|
|
|
|
internal: true
|
|
|
|
|
run: once
|
|
|
|
|
preconditions:
|
|
|
|
|
- sh: test "${DIRENV_DIR#-}" = "{{.TASKFILE_DIR}}"
|
|
|
|
|
msg: "Not in nix dev shell. Run: nix develop"
|
|
|
|
|
|
2026-04-17 12:17:51 +02:00
|
|
|
_flutter-check:
|
2026-04-17 10:05:31 +02:00
|
|
|
internal: true
|
|
|
|
|
run: once
|
|
|
|
|
deps: [_nix-check]
|
2026-04-17 12:17:51 +02:00
|
|
|
cmds:
|
2026-04-17 22:20:10 +02:00
|
|
|
- cmd: fvm install --skip-pub-get
|
2026-04-17 12:17:51 +02:00
|
|
|
|
|
|
|
|
_pub-get:
|
|
|
|
|
internal: true
|
|
|
|
|
run: once
|
|
|
|
|
deps: [_flutter-check]
|
2026-04-17 10:05:31 +02:00
|
|
|
cmds:
|
2026-04-17 22:20:10 +02:00
|
|
|
- fvm flutter pub get --suppress-analytics
|
|
|
|
|
|
|
|
|
|
_linux-deps-check:
|
|
|
|
|
internal: true
|
|
|
|
|
run: once
|
|
|
|
|
preconditions:
|
|
|
|
|
- sh: command -v clang >/dev/null 2>&1
|
|
|
|
|
msg: "Linux desktop deps missing. Run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev libstdc++-12-dev"
|
|
|
|
|
- sh: pkg-config --exists gtk+-3.0 2>/dev/null
|
|
|
|
|
msg: "Linux desktop deps missing. Run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev libstdc++-12-dev"
|
2026-04-17 10:05:31 +02:00
|
|
|
|
2026-04-16 09:55:15 +02:00
|
|
|
install-hooks:
|
2026-04-16 15:14:18 +02:00
|
|
|
desc: Install pre-commit hooks (requires pre-commit; see .pre-commit-config.yaml)
|
2026-04-16 09:55:15 +02:00
|
|
|
cmds:
|
2026-04-16 15:14:18 +02:00
|
|
|
- pre-commit install
|
2026-04-16 09:55:15 +02:00
|
|
|
|
2026-04-16 07:40:34 +02:00
|
|
|
codegen:
|
2026-04-16 08:11:29 +02:00
|
|
|
desc: Generate Drift DB code (run after any schema change)
|
2026-04-17 10:05:31 +02:00
|
|
|
deps: [_nix-check, _pub-get]
|
2026-04-16 07:40:34 +02:00
|
|
|
cmds:
|
2026-04-17 22:20:10 +02:00
|
|
|
- fvm flutter pub run build_runner build --delete-conflicting-outputs
|
2026-04-16 07:40:34 +02:00
|
|
|
|
|
|
|
|
analyze:
|
2026-04-16 11:48:37 +02:00
|
|
|
desc: Static analysis (flutter analyze)
|
2026-04-17 10:05:31 +02:00
|
|
|
deps: [_nix-check, _pub-get]
|
2026-04-16 07:40:34 +02:00
|
|
|
cmds:
|
2026-04-16 11:48:37 +02:00
|
|
|
- scripts/run_analyze.sh
|
2026-04-16 07:40:34 +02:00
|
|
|
|
|
|
|
|
analyze-fix:
|
2026-04-16 08:11:29 +02:00
|
|
|
desc: Auto-fix lint issues with dart fix --apply
|
2026-04-16 07:40:34 +02:00
|
|
|
deps: [_nix-check]
|
|
|
|
|
cmds:
|
2026-04-17 22:20:10 +02:00
|
|
|
- fvm dart fix --apply
|
2026-04-16 07:40:34 +02:00
|
|
|
|
|
|
|
|
test:
|
2026-04-16 11:48:37 +02:00
|
|
|
desc: Unit tests + coverage gate (fails if any non-excluded lib/ file is missing)
|
2026-04-17 10:05:31 +02:00
|
|
|
deps: [_nix-check, _pub-get]
|
2026-04-16 07:40:34 +02:00
|
|
|
cmds:
|
2026-04-16 11:48:37 +02:00
|
|
|
- scripts/run_unit_tests.sh
|
2026-04-16 07:40:34 +02:00
|
|
|
|
2026-04-16 15:14:18 +02:00
|
|
|
test-widget:
|
|
|
|
|
desc: Widget tests — headless, no display or network required
|
2026-04-17 10:05:31 +02:00
|
|
|
deps: [_nix-check, _pub-get]
|
2026-04-16 15:14:18 +02:00
|
|
|
cmds:
|
2026-04-17 10:05:31 +02:00
|
|
|
- scripts/run_widget_tests.sh
|
2026-04-16 15:14:18 +02:00
|
|
|
|
2026-04-16 08:11:29 +02:00
|
|
|
test-flutter:
|
2026-04-16 15:14:18 +02:00
|
|
|
desc: Full Flutter test suite (unit + widget + integration)
|
2026-04-16 08:11:29 +02:00
|
|
|
deps: [_nix-check]
|
|
|
|
|
cmds:
|
2026-04-17 22:20:10 +02:00
|
|
|
- fvm flutter test
|
2026-04-16 08:11:29 +02:00
|
|
|
|
2026-04-16 07:40:34 +02:00
|
|
|
integration:
|
2026-04-16 11:48:37 +02:00
|
|
|
desc: Integration tests against a local Stalwart mail server
|
2026-04-17 12:17:51 +02:00
|
|
|
deps: [_flutter-check]
|
2026-04-16 07:40:34 +02:00
|
|
|
cmds:
|
2026-04-16 11:48:37 +02:00
|
|
|
- stalwart-dev/test.sh
|
2026-04-16 07:40:34 +02:00
|
|
|
|
2026-04-17 10:05:31 +02:00
|
|
|
build-linux:
|
|
|
|
|
desc: Build the Linux desktop app (debug)
|
2026-04-17 22:20:10 +02:00
|
|
|
deps: [_nix-check, _linux-deps-check, _pub-get]
|
2026-04-17 10:05:31 +02:00
|
|
|
cmds:
|
2026-04-17 22:20:10 +02:00
|
|
|
- fvm flutter build linux --debug --no-pub
|
2026-04-17 10:05:31 +02:00
|
|
|
|
2026-04-16 09:43:24 +02:00
|
|
|
build-android:
|
|
|
|
|
desc: Build a release APK (output in build/app/outputs/flutter-apk/)
|
2026-04-17 10:05:31 +02:00
|
|
|
deps: [_nix-check, _pub-get]
|
2026-04-16 09:43:24 +02:00
|
|
|
cmds:
|
2026-04-17 22:20:10 +02:00
|
|
|
- fvm flutter build apk --release --no-pub
|
2026-04-16 09:43:24 +02:00
|
|
|
|
2026-04-16 07:40:34 +02:00
|
|
|
run:
|
|
|
|
|
desc: Run the app on Linux desktop
|
2026-04-17 22:20:10 +02:00
|
|
|
deps: [_nix-check, _linux-deps-check, _pub-get]
|
2026-04-16 07:40:34 +02:00
|
|
|
cmds:
|
2026-04-17 22:20:10 +02:00
|
|
|
- fvm flutter run -d linux --no-pub
|
2026-04-16 07:40:34 +02:00
|
|
|
|
2026-04-18 16:16:35 +02:00
|
|
|
check-fast:
|
|
|
|
|
desc: Pre-commit checks — analyze + unit tests + widget tests (no build, no integration)
|
|
|
|
|
deps: [analyze, test, test-widget]
|
|
|
|
|
|
2026-04-16 07:40:34 +02:00
|
|
|
check:
|
2026-04-18 16:16:35 +02:00
|
|
|
desc: Full check suite — analyze + unit tests + widget tests + build-linux + integration in parallel
|
2026-04-17 10:05:31 +02:00
|
|
|
deps: [analyze, test, test-widget, build-linux, integration]
|