-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
156 lines (126 loc) · 4.98 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
.PHONY: all run_dev_web run_dev_mobile run_unit clean upgrade lint format build_dev_mobile help
all: lint format run_dev_mobile
# Adding a help file: https://gist.github.com/prwhite/8168133#gistcomment-1313022
help: ## This help dialog.
@IFS=$$'\n' ; \
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//'`); \
for help_line in $${help_lines[@]}; do \
IFS=$$'#' ; \
help_split=($$help_line) ; \
help_command=`echo $${help_split[0]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
help_info=`echo $${help_split[2]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
printf "%-30s %s\n" $$help_command $$help_info ; \
done
run_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
format: ## Formats the code
@echo "╠ Formatting the code"
@dart format . -l 120
lint: ## Lints the code
@echo "╠ Verifying code..."
@dart analyze . || (echo "Error in project"; exit 1)
upgrade: clean ## Upgrades dependencies
@echo "╠ Upgrading dependencies..."
@flutter pub upgrade
get: ## get dependencies
@echo "╠ getting dependencies..."
@flutter packages pub get
commit: format lint
@echo "╠ Committing..."
git add .
git commit
run_dev_web: ## Runs the web application in development
@echo "╠ Running the app"
@flutter run -d chrome --dart-define=ENVIRONMENT=dev
run_dev_mobile: ## Runs the mobile application in development
@echo "╠ Running the app"
@flutter run --flavor development
build_dev: clean ## Build apk for development flavor
@echo "╠ Building the app"
@echo "╠ flavor = development"
@flutter build apk --flavor development -t lib/main_development.dart
build_apk: clean ## Build apk for development flavor
@echo "╠ Building the apk"
@flutter build apk -t lib/main.dart
build_stg: clean ## Build apk for staging flavor
@echo "╠ Building the app"
@echo "╠ flavor = Staging"
@flutter build apk --flavor staging -t lib/main_staging.dart
build_prod: clean ## Build appble for production flavor and uploading to store
@echo "╠ Building the app"
@echo "╠ flavor = production"
@flutter build appbundle --release --flavor production -t lib/main_production.dart
build_prod_unf: clean ## Build appble for production flavor and uploading to store
@echo "╠ Building the app"
@echo "╠ flavor = production"
@flutter build appbundle --release
build_runner: ## Build appble for production flavor and uploading to store
@echo "╠ Running build to generate files"
@flutter pub run build_runner watch --delete-conflicting-outputs
build_format: ## run build_runner and format files
@echo "╠ Running build to generate files"
@dart run build_runner build --delete-conflicting-outputs
@echo "╠ Formatting the code"
@dart format . -l 120
bf: ## run build_runner and format files
@echo "╠ Running build to generate files"
@dart run build_runner build --delete-conflicting-outputs
@echo "╠ Formatting the code"
@dart format . -l 120
clean_unused_local: ## List and clean unused localizations
@echo "╠ Listing unused terms in localizations"
@dart run translations_cleaner list-unused-terms
@echo "╠ Cleaning unused terms in localizations "
@dart run translations_cleaner clean-translations
list_unused_local: ## Just listing unused localizations
@echo "╠ Listing unused terms in localizations"
@dart run translations_cleaner list-unused-terms
remove_unused_png: #Just listing unused png images
@echo "╠ Running unused assets png images"
@ flutter pub run delete_un_used_assets:start /assets/images/png
remove_unused_svg: ## Just listing unused svg images
@echo "╠ Running unused assets svg images"
@ flutter pub run delete_un_used_assets:start /assets/images/svg
fire: # Install flutterfire
@echo "╠ Running Global Active Flutter Fire Client"
@dart pub global activate flutterfire_cli
@echo "╠ Running Flutter Fire Configure"
@flutterfire configure
splash: # Setup splash screen
@echo "╠ Running flutter clean"
@flutter clean
@echo "╠ Running flutter pub get"
@flutter pub get
@echo "╠ Running flutter pub run flutter_native_splash:remove"
@dart run flutter_native_splash:remove
@echo "╠ Running flutter pub run flutter_native_splash:create"
@dart run flutter_native_splash:create
podrepo: ## Run pod install
@echo "╠ Removing Podfile.lock"
@rm -rf ios/Podfile.lock
@echo "╠ Running pod install --repo-update"
@cd ios && pod install --repo-update
@echo "╠ Done"
@cd ..
cgr: ## Clean & Get & Repo update use root project directory!
@echo "╠ Cleaning the project..."
@rm -rf pubspec.lock
@flutter clean
@echo "╠ getting dependencies..."
@flutter pub get
@echo "╠ Removing Podfile.lock"
@rm -rf ios/Podfile.lock
@echo "╠ Running pod install --repo-update"
@cd ios && pod install --repo-update
@echo "╠ Done"
@cd ..
cg: ## Clean & Pub Get
@echo "╠ Make clean running..."
@make clean
@echo "╠ Make get running..."
@make get