|
| 1 | +.PHONY: all run_dev_web run_dev_mobile run_unit clean upgrade lint format build_dev_mobile help |
| 2 | + |
| 3 | +all: lint format run_dev_mobile |
| 4 | + |
| 5 | +# Adding a help file: https://gist.github.com/prwhite/8168133#gistcomment-1313022 |
| 6 | +help: ## This help dialog. |
| 7 | + @IFS=$$'\n' ; \ |
| 8 | + help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//'`); \ |
| 9 | + for help_line in $${help_lines[@]}; do \ |
| 10 | + IFS=$$'#' ; \ |
| 11 | + help_split=($$help_line) ; \ |
| 12 | + help_command=`echo $${help_split[0]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \ |
| 13 | + help_info=`echo $${help_split[2]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \ |
| 14 | + printf "%-30s %s\n" $$help_command $$help_info ; \ |
| 15 | + done |
| 16 | + |
| 17 | +run_unit: ## Runs unit tests |
| 18 | + @echo "╠ Running the tests" |
| 19 | + @flutter test || (echo "Error while running tests"; exit 1) |
| 20 | + |
| 21 | +clean: ## Cleans the environment |
| 22 | + @echo "╠ Cleaning the project..." |
| 23 | + @rm -rf pubspec.lock |
| 24 | + @flutter clean |
| 25 | + @flutter pub get |
| 26 | + |
| 27 | +watch: ## Watches the files for changes |
| 28 | + @echo "╠ Watching the project..." |
| 29 | + @flutter pub run build_runner watch --delete-conflicting-outputs |
| 30 | + |
| 31 | +gen: ## Generates the assets |
| 32 | + @echo "╠ Generating the assets..." |
| 33 | + @flutter pub get |
| 34 | + @flutter packages pub run build_runner build |
| 35 | + |
| 36 | +format: ## Formats the code |
| 37 | + @echo "╠ Formatting the code" |
| 38 | + @dart format lib . |
| 39 | + @flutter pub run import_sorter:main |
| 40 | + @flutter format lib |
| 41 | + |
| 42 | +lint: ## Lints the code |
| 43 | + @echo "╠ Verifying code..." |
| 44 | + @dart analyze . || (echo "Error in project"; exit 1) |
| 45 | + |
| 46 | +upgrade: clean ## Upgrades dependencies |
| 47 | + @echo "╠ Upgrading dependencies..." |
| 48 | + @flutter pub upgrade |
| 49 | + |
| 50 | +commit: format lint run_unit |
| 51 | + @echo "╠ Committing..." |
| 52 | + git add . |
| 53 | + git commit |
| 54 | + |
| 55 | +run_dev_web: ## Runs the web application in dev |
| 56 | + @echo "╠ Running the app" |
| 57 | + @flutter run -d chrome --dart-define=ENVIRONMENT=dev |
| 58 | + |
| 59 | +run_dev_mobile: ## Runs the mobile application in dev |
| 60 | + @echo "╠ Running the app" |
| 61 | + @flutter run --flavor development -t lib/main_development.dart |
| 62 | + |
| 63 | +run_stg_mobile: ## Runs the mobile application in dev |
| 64 | + @echo "╠ Running the app" |
| 65 | + @flutter run --flavor staging -t lib/main_staging.dart |
| 66 | + |
| 67 | +run_prd_mobile: ## Runs the mobile application in dev |
| 68 | + @echo "╠ Running the app" |
| 69 | + @flutter run --flavor production -t lib/main_production.dart |
| 70 | + |
| 71 | +build_apk_dev: ## Runs the mobile application in dev |
| 72 | + @flutter clean |
| 73 | + @flutter pub get |
| 74 | + @flutter build apk --flavor development -t lib/main_development.dart |
| 75 | + |
| 76 | +build_apk_stg: ## Runs the mobile application in staging |
| 77 | + @flutter clean |
| 78 | + @flutter pub get |
| 79 | + @flutter build apk --flavor staging -t lib/main_staging.dart |
| 80 | + |
| 81 | +build_apk_prod: ## Runs the mobile application in prod |
| 82 | + @flutter clean |
| 83 | + @flutter pub get |
| 84 | + @flutter build apk --flavor production -t lib/main_production.dart |
| 85 | + |
| 86 | +purge: ## Purges the Flutter |
| 87 | + @pod deintegrate |
| 88 | + @flutter clean |
| 89 | + @flutter pub get |
| 90 | + |
| 91 | + |
0 commit comments