Make
Use Make to run many Flutter commands with one short command
What is Make?
Install Make
brew install makeAdd Make to a Flutter Project
Step 1: Create Makefile in project root
Makefile in project rootFVM := fvm
FVM_CACHE_PATH := $(CURDIR)/.fvm_cache
FVM_ENV := FVM_CACHE_PATH=$(FVM_CACHE_PATH) FLUTTER_SUPPRESS_ANALYTICS=true DART_SUPPRESS_ANALYTICS=true
.PHONY: init
init:
@echo "Using FVM cache at $(FVM_CACHE_PATH)"
$(FVM_ENV) $(FVM) install 3.27.4
$(FVM_ENV) $(FVM) use 3.27.4 --force
$(FVM_ENV) $(FVM) flutter pub getStep 2: Run
Real Examples from My Makefile
Example 1: Full setup for new teammate
Example 2: Get dependencies for many packages
Example 3: Push flow
Why Make Is Efficient
Conclusion
Last updated