-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
45 lines (40 loc) · 1.75 KB
/
Makefile
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
.PHONY: generate
generate:
flutter pub run build_runner build --delete-conflicting-outputs
.PHONY: sort
sort:
flutter pub run import_sorter:main
.PHONY: test
test:
rm -rf coverage* && \
flutter test --coverage test/ && \
lcov --remove coverage/lcov.info 'lib/**/*.g.dart' -o coverage/lcov.info && \
lcov --remove coverage/lcov.info 'lib/**/*.freezed.dart' -o coverage/lcov.info && \
lcov --remove coverage/lcov.info 'lib/**/*.gr.dart' -o coverage/lcov.info && \
lcov --remove coverage/lcov.info 'lib/infrastructure/repository/sqlite.dart' -o coverage/lcov.info \
genhtml -q -o coverage coverage/lcov.info && \
google-chrome coverage/index.html
.PHONY: covTest
covTest:
rm -rf coverage* && \
flutter test test/ && \
lcov --remove coverage/lcov.info 'lib/**/*.g.dart' -o coverage/lcov.info && \
lcov --remove coverage/lcov.info 'lib/**/*.freezed.dart' -o coverage/lcov.info && \
lcov --remove coverage/lcov.info 'lib/infrastructure/repository/sqlite.dart' -o coverage/lcov.info \
lcov --remove coverage/lcov.info 'lib/**/*.gr.dart' -o coverage/lcov.info && \
genhtml -q -o coverage coverage/lcov.info
.PHONY: run
run:
flutter clean && flutter pub get && flutter analyze && flutter run
### Example
# make test-file this=<file-path>
###
.PHONY: test-file
test-file:
rm -rf coverage* && \
flutter test --coverage $(this) && lcov --remove coverage/lcov.info 'lib/**/*.g.dart' -o coverage/lcov.info && \
lcov --remove coverage/lcov.info 'lib/**/*.freezed.dart' -o coverage/lcov.info && \
lcov --remove coverage/lcov.info 'lib/infrastructure/repository/sqlite.dart' -o coverage/lcov.info \
lcov --remove coverage/lcov.info 'lib/**/*.gr.dart' -o coverage/lcov.info && \
genhtml -q -o coverage coverage/lcov.info && \
google-chrome coverage/index.html