-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
94 lines (72 loc) · 2.37 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
### (from run write command)
### make <command name>
### ( example: make lint)
## List command name
all: lint format run_dev_mobile
info:
@echo "╠ Start get info..."
@dart info
gen: ## Generates the assets
@echo "╠ Generating the assets..."
@flutter packages pub run build_runner build
@flutter gen-l10n
@flutter pub run intl_utils:generate
## dart run build_runner build --delete-conflicting-outputs
buildrunner: ## Build the files for changes
@echo "╠ Building the project..."
@flutter pub run build_runner build --delete-conflicting-outputs
format: ## Formats the code
@echo "╠ Formatting the code"
@dart format lib .
@flutter pub run import_sorter:main
@flutter format lib
check:
@echo "╠ Check code..."
@flutter --version
@flutter pub get
@flutter analyze .
@dart format --set-exit-if-changed .
@flutter test --coverage
## * The dart pub outdated command helps find outdated dependencies, which is also useful for keeping your project clean.
## * The dart analyze command helps find errors and warnings in your code, including unused variables and methods.
code_clean:
@dart pub outdated
@dart analyze
@dart pub run dart_code_metrics:metrics lib --reporter=html
# dart analyze --fatal-infos
stylecode:
@echo "╠ Style code code..."
@dart analyze . || (echo "Error in project"; exit 1)
@dart fix --dry-run || (echo "Error in project"; exit 2)
@dart fix --apply || (echo "Error in project"; exit 3)
@dart format . || (echo "Error in project"; exit 5)
lint: ## Lints the code
@echo "╠ Verifying code..."
@dart analyze . || (echo "Error in project"; exit 1)
unit: ## Runs unit tests
@echo "╠ Running the tests"
@flutter test || (echo "Error while running tests"; exit 1)
clean: ## Cleans the environment
@echo "╠ Cleaning the project..."
@rm -rf pubspec.lock
@flutter clean
@flutter pub get
docs:
@echo "╠ Create docs project..."
@dart doc .
# dart doc --output=api_docs .
# dart doc --dry-run .
settingproject:
@echo "╠ Settings project..."
@dart format config --line-length=80
# $ dart pub run dart_code_metrics:metrics lib
# # or for a Flutter package
# $ flutter pub run dart_code_metrics:metrics lib
# ====
# $ dart pub run dart_code_metrics:metrics lib --reporter=html
# # or for a Flutter package
# $ flutter pub run dart_code_metrics:metrics lib --reporter=html
ios:
flutter build ipa
android:
flutter build appbundle --no-shrink