Skip to content

Instantly share code, notes, and snippets.

@ethicnology
Created August 29, 2025 18:28
Show Gist options
  • Select an option

  • Save ethicnology/6cd19ebdfe819e9ecb52a891ca1dbd20 to your computer and use it in GitHub Desktop.

Select an option

Save ethicnology/6cd19ebdfe819e9ecb52a891ca1dbd20 to your computer and use it in GitHub Desktop.
Flutter makefile for new projects
.PHONY: fvm-check setup clean dependencies build-runner translations pods-update test unit-test integration-test
fvm-check:
@echo "πŸ” Checking FVM"
@if ! command -v fvm >/dev/null 2>&1; then \
echo "❌ FVM is not installed. Please install FVM first:"; \
exit 1; \
fi
@echo "βœ… FVM is installed"
@fvm install
init:
@echo "πŸš€ Initializing a new project"
@git init
@flutter create .
@fvm use
setup: fvm-check dependencies build-runner translations pods-update
@echo "πŸš€ Setup complete!"
dependencies:
@echo "πŸƒ Fetch dependencies"
@fvm flutter clean
@rm -f pubspec.lock
@fvm flutter pub get
build-runner:
@echo "πŸ—οΈ Build runner for json_serializable and flutter_gen"
@fvm dart run build_runner build --delete-conflicting-outputs
translations:
@echo "🌐 Generating translations files"
@fvm flutter gen-l10n
pods-update:
@echo "ο£Ώ Fetching dependencies"
@fvm flutter precache --ios
@cd ios && rm -f Podfile.lock && pod install --repo-update && cd -
test: unit-test integration-test
unit-test:
@echo "πŸƒβ€ running unit tests"
@fvm flutter test test/ --reporter=compact
integration-test:
@echo "πŸ§ͺ integration tests"
@fvm flutter test integration_test/ --reporter=compact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment