Skip to content

Commit a8e3be9

Browse files
committed
👷 Added Makefile
1 parent c2434e6 commit a8e3be9

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

Makefile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Makefile
2+
3+
help:
4+
@printf "%-20s %s\n" "Target" "Description"
5+
@printf "%-20s %s\n" "------" "-----------"
6+
@make -pqR : 2>/dev/null \
7+
| awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' \
8+
| sort \
9+
| egrep -v -e '^[^[:alnum:]]' -e '^$@$$' \
10+
| xargs -I _ sh -c 'printf "%-20s " _; make _ -nB | (grep -i "^# Help:" || echo "") | tail -1 | sed "s/^# Help: //g"'
11+
12+
analyze:
13+
@# Help: Analyze the project's Dart code.
14+
dart analyze --fatal-infos
15+
16+
check_format:
17+
@# Help: Check the formatting of one or more Dart files.
18+
dart format --output=none --set-exit-if-changed .
19+
20+
check_outdated:
21+
@# Help: Check which of the project's packages are outdated.
22+
dart pub outdated
23+
24+
check_style:
25+
@# Help: Analyze the project's Dart code and check the formatting one or more Dart files.
26+
make analyze && make check_format
27+
28+
format:
29+
@# Help: Format one or more Dart files.
30+
dart format .
31+
32+
install:
33+
@# Help: Install all the project's packages
34+
dart pub get
35+
36+
sure:
37+
@# Help: Analyze the project's Dart code, check the formatting one or more Dart files and run unit tests for the current project.
38+
make check_style && make tests
39+
40+
show_test_coverage:
41+
@# Help: Run Dart unit tests for the current project and show the coverage.
42+
dart pub global activate coverage && dart pub global run coverage:test_with_coverage
43+
lcov --remove coverage/lcov.info -o coverage/lcov_without_generated_code.info --ignore-errors unused
44+
genhtml coverage/lcov_without_generated_code.info -o coverage/html
45+
open coverage/html/index.html
46+
47+
tests:
48+
@# Help: Run Dart unit tests for the current project.
49+
dart test

0 commit comments

Comments
 (0)