-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
115 lines (98 loc) · 3.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
.PHONY: help
help: ## Help dialog
@echo 'Usage: make <OPTIONS> ... <TARGETS>'
@echo ''
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: doctor
doctor: ## Check fvm flutter doctor
@fvm flutter doctor
.PHONY: version
version: ## Check fvm flutter version
@fvm flutter --version
.PHONY: format
format: ## Format code
@echo "╠ RUN FORMAT THE CODE"
@fvm dart format --fix -l 80 . || (echo "👀 Format code error 👀"; exit 1)
@echo "╠ CODE FORMATED SUCCESSFULLY"
.PHONY: fix
fix: format ## Fix code
@fvm dart fix --apply lib
.PHONY: clean-cache
clean-cache: ## Clean the pub cache
@echo "╠ CLEAN PUB CACHE"
@fvm flutter pub cache repair
@echo "╠ PUB CACHE CLEANED SUCCESSFULLY"
.PHONY: clean
clean: ## Clean flutter
@echo "╠ RUN FLUTTER CLEAN"
@fvm flutter clean
@echo "╠ FLUTTER CLEANED SUCCESSFULLY"
.PHONY: get
get: ## Get dependencies
@echo "╠ RUN GET DEPENDENCIES..."
@flutter pub get || (echo "▓▓ Get dependencies error ▓▓"; exit 1)
@echo "╠ DEPENDENCIES GETED SUCCESSFULLY"
.PHONY: analyze
analyze: get format ## Analyze code
@echo "╠ RUN ANALYZE THE CODE..."
@dart analyze --fatal-infos --fatal-warnings
@echo "╠ ANALYZED CODE SUCCESSFULLY"
.PHONY: check
check: analyze ## Check code
@echo "╠ RUN CECK CODE..."
@dart pub publish --dry-run
@dart pub global activate pana
@pana --json --no-warning --line-length 80 > log.pana.json
@echo "╠ CECKED CODE SUCCESSFULLY"
.PHONY: publish
publish: ## Publish package
@echo "╠ RUN PUBLISHING..."
@dart pub publish --server=https://pub.dartlang.org || (echo "▓▓ Publish error ▓▓"; exit 1)
@echo "╠ PUBLISH PACKAGE SUCCESSFULLY"
.PHONY: coverage
coverage: ## Runs get coverage
@lcov --summary coverage/lcov.info
.PHONY: run-genhtml
run-genhtml: ## Runs generage coverage html
@genhtml coverage/lcov.info -o coverage/html
.PHONY: test-unit
test-unit: ## Runs unit tests
@echo "╠ RUNNING UNIT TESTS..."
@flutter test --coverage || (echo "Error while running tests"; exit 1)
@genhtml coverage/lcov.info --output=coverage -o coverage/html || (echo "Error while running genhtml with coverage"; exit 2)
@echo "╠ UNIT TESTS SUCCESSFULLY"
.PHONY: tag-add
tag-add: ## Make command to add TAG. E.g: make tag-add TAG=v1.0.0
@if [ -z "$(TAG)" ]; then echo "TAG is not set"; exit 1; fi
@echo ""
@echo "START ADDING TAG: $(TAG)"
@echo ""
@git tag $(TAG)
@git push origin $(TAG)
@echo ""
@echo "CREATED AND PUSHED TAG $(TAG)"
@echo ""
.PHONY: tag-remove
tag-remove: ## Make command to delete TAG. E.g: make tag-delete TAG=v1.0.0
@if [ -z "$(TAG)" ]; then echo "TAG is not set"; exit 1; fi
@echo ""
@echo "START REMOVING TAG: $(TAG)"
@echo ""
@git tag -d $(TAG)
@git push origin --delete $(TAG)
@echo ""
@echo "DELETED TAG $(TAG) LOCALLY AND REMOTELY"
@echo ""
.PHONY: build
build: clean analyze test-unit ## Build test apk for android on example apps
@echo "╠ START BUILD EXAMPLES..."
@echo "║"
@echo "╠ START BUILD ANDROID APK & IOS IPA FOR GRADLE < 8..."
@cd example && fvm flutter clean && fvm flutter pub get && fvm flutter build apk --release && fvm flutter build ios --release --no-codesign
@echo "╠ FINISHED BUILD ANDROID APK FOR GRADLE < 8..."
@echo "║"
@echo "╠ START BUILD ANDROID APK & IOS IPA FOR GRADLE > 8..."
@cd example_gradle_8 && fvm flutter clean && fvm flutter pub get && fvm flutter build apk --release && fvm flutter build ios --release --no-codesign
@echo "╠ FINISH BUILD ANDROID APK FOR GRADLE > 8..."
@echo "║"
@echo "╠ FINISH BUILD EXAMPLES..."