-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (36 loc) · 1.45 KB
/
Copy pathMakefile
File metadata and controls
48 lines (36 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
.PHONY: help format format-check analyze pubget run-web build-web clean test setup coverage
help:
@echo "Available targets:"
@echo " make setup - Install deps and git hooks (lefthook)"
@echo " make format - Run official Dart formatter"
@echo " make format-check - Check formatting (CI)"
@echo " make analyze - Run flutter analyze"
@echo " make test - Run flutter test"
@echo " make coverage - Run tests and show coverage"
@echo " make pubget - Run flutter pub get"
@echo " make run-web - Run flutter run"
@echo " make build-web - Build web with offline-first PWA"
@echo " make clean - Run flutter clean"
setup:
flutter pub get
@command -v lefthook >/dev/null 2>&1 && lefthook install || echo "Install lefthook: https://github.com/evilmartians/lefthook#install"
format:
dart format .
format-check:
dart format --set-exit-if-changed .
analyze:
flutter analyze
test:
flutter test
pubget:
flutter pub get
run-web:
flutter run -d web-server --web-port=8080 --web-hostname=0.0.0.0
coverage:
flutter test --coverage
@awk 'BEGIN{s=0}/^SF:.*lib\/l10n\//{s=1}/^end_of_record/{if(s){s=0;next}}!s' coverage/lcov.info > coverage/lcov_filtered.info
@awk '/^LF:/{t+=substr($$0,4)}/^LH:/{h+=substr($$0,4)}END{printf "Coverage: %.1f%% (excluding generated l10n)\n",h/t*100}' coverage/lcov_filtered.info
build-web:
flutter build web --release --pwa-strategy=offline-first
clean:
flutter clean