-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (35 loc) · 1.14 KB
/
Makefile
File metadata and controls
46 lines (35 loc) · 1.14 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
info: menu select
menu:
echo "1 make reset - flutter clean && flutter pub get"
echo "2 make format - dart format ."
echo "3 make test - flutter test"
echo "4 make analyze - flutter analyze"
echo "5 make build - flutter build web"
echo "6 make run - flutter run --debug"
echo "7 make update_phony - update .PHONY in Makefile"
select:
read -p ">>> " P ; make menu | grep "^$$P " | cut -d ' ' -f2-3 ; make menu | grep "^$$P " | cut -d ' ' -f2-3 | bash
.SILENT:
.PHONY: info menu select reset format test analyze build run deploy update_phony
reset:
flutter clean && flutter pub get
format:
dart format .
test:
flutter test
analyze:
flutter analyze
build:
echo "##### Clean build #####"
flutter clean
rm -fvr build
echo "##### Build for web #####"
flutter build web
run:
flutter run --debug
update_phony:
@echo "##### Updating .PHONY targets #####"
@targets=$$(grep -E '^[a-zA-Z_][a-zA-Z0-9_-]*:' Makefile | grep -v '=' | cut -d: -f1 | tr '\n' ' '); \
sed -i.bak "s/^\.PHONY:.*/.PHONY: $$targets/" Makefile && \
echo "Updated .PHONY: $$targets" && \
rm -f Makefile.bak