Created
January 20, 2026 11:48
-
-
Save sixtusagbo/f23ac8ab8ab1da2b00e5a69814411ae9 to your computer and use it in GitHub Desktop.
Flutter + Firebase Makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # A collection of useful commands for Flutter projects with Firebase backend | |
| # | |
| # Usage: Copy this file to your project root and update FIREBASE_PROJECT_ID | |
| # ============================================================================ | |
| # CONFIGURATION - Update these for your project | |
| # ============================================================================ | |
| FIREBASE_PROJECT_ID := your-firebase-project-id | |
| # ============================================================================ | |
| # PHONY TARGETS | |
| # ============================================================================ | |
| .PHONY: help assets watch reset pods-reset \ | |
| build-appbundle build-apk build-ipa \ | |
| deploy-all deploy-functions deploy-firestore deploy-rules deploy-indexes \ | |
| functions-install functions-build \ | |
| signing-report xcode clean analyze test | |
| # ============================================================================ | |
| # HELP | |
| # ============================================================================ | |
| .DEFAULT_GOAL := help | |
| help: | |
| @echo "Flutter + Firebase Makefile" | |
| @echo "" | |
| @echo "Flutter:" | |
| @echo " make assets - Run build_runner to generate code" | |
| @echo " make watch - Run build_runner in watch mode" | |
| @echo " make reset - Clean, get dependencies, run build_runner" | |
| @echo " make pods-reset - Clean and reinstall iOS pods" | |
| @echo " make clean - Run flutter clean" | |
| @echo " make analyze - Run flutter analyze" | |
| @echo " make test - Run flutter test" | |
| @echo "" | |
| @echo "Build:" | |
| @echo " make build-appbundle - Build Android app bundle (.aab)" | |
| @echo " make build-apk - Build Android APK" | |
| @echo " make build-ipa - Build iOS archive (.ipa)" | |
| @echo "" | |
| @echo "Firebase Deploy:" | |
| @echo " make deploy-all - Deploy everything to Firebase" | |
| @echo " make deploy-functions - Deploy Cloud Functions only" | |
| @echo " make deploy-firestore - Deploy Firestore rules + indexes" | |
| @echo " make deploy-rules - Deploy Firestore rules only" | |
| @echo " make deploy-indexes - Deploy Firestore indexes only" | |
| @echo "" | |
| @echo "Firebase Functions:" | |
| @echo " make functions-install - Install functions dependencies" | |
| @echo " make functions-build - Build functions (TypeScript)" | |
| @echo "" | |
| @echo "Utilities:" | |
| @echo " make signing-report - Get Android SHA-1 signing report" | |
| @echo " make xcode - Open iOS project in Xcode" | |
| # ============================================================================ | |
| # FLUTTER COMMANDS | |
| # ============================================================================ | |
| assets: | |
| @echo "Running build_runner..." | |
| dart run build_runner build --delete-conflicting-outputs | |
| @echo "Done." | |
| watch: | |
| @echo "Starting build_runner in watch mode..." | |
| dart run build_runner watch --delete-conflicting-outputs | |
| reset: | |
| @echo "Cleaning..." | |
| flutter clean | |
| @echo "Getting dependencies..." | |
| flutter pub get | |
| @echo "Running build_runner..." | |
| dart run build_runner build --delete-conflicting-outputs | |
| @echo "Reset complete." | |
| pods-reset: | |
| @echo "Cleaning iOS pods..." | |
| cd ios && rm -rf Pods Podfile.lock && pod install | |
| @echo "Pods reinstalled." | |
| clean: | |
| flutter clean | |
| analyze: | |
| flutter analyze | |
| test: | |
| flutter test | |
| # ============================================================================ | |
| # BUILD COMMANDS | |
| # ============================================================================ | |
| build-appbundle: | |
| @echo "Building Android app bundle..." | |
| flutter build appbundle | |
| @echo "App bundle created at build/app/outputs/bundle/release/" | |
| build-apk: | |
| @echo "Building Android APK..." | |
| flutter build apk | |
| @echo "APK created at build/app/outputs/flutter-apk/" | |
| build-ipa: | |
| @echo "Building iOS archive..." | |
| flutter build ipa --release | |
| @echo "IPA created at build/ios/ipa/" | |
| # ============================================================================ | |
| # FIREBASE DEPLOY COMMANDS | |
| # ============================================================================ | |
| deploy-all: | |
| @echo "Deploying everything to Firebase..." | |
| firebase deploy --project $(FIREBASE_PROJECT_ID) | |
| @echo "Deployment complete." | |
| deploy-functions: | |
| @echo "Deploying Cloud Functions..." | |
| firebase deploy --only functions --project $(FIREBASE_PROJECT_ID) | |
| @echo "Functions deployed." | |
| deploy-firestore: | |
| @echo "Deploying Firestore rules and indexes..." | |
| firebase deploy --only firestore --project $(FIREBASE_PROJECT_ID) | |
| @echo "Firestore deployed." | |
| deploy-rules: | |
| @echo "Deploying Firestore rules..." | |
| firebase deploy --only firestore:rules --project $(FIREBASE_PROJECT_ID) | |
| @echo "Rules deployed." | |
| deploy-indexes: | |
| @echo "Deploying Firestore indexes..." | |
| firebase deploy --only firestore:indexes --project $(FIREBASE_PROJECT_ID) | |
| @echo "Indexes deployed." | |
| # ============================================================================ | |
| # FIREBASE FUNCTIONS COMMANDS | |
| # ============================================================================ | |
| functions-install: | |
| @echo "Installing functions dependencies..." | |
| cd functions && npm install | |
| @echo "Dependencies installed." | |
| functions-build: | |
| @echo "Building functions..." | |
| cd functions && npm run build | |
| @echo "Build complete." | |
| # ============================================================================ | |
| # UTILITY COMMANDS | |
| # ============================================================================ | |
| signing-report: | |
| @echo "Getting Android signing report..." | |
| cd android && ./gradlew signingReport | |
| xcode: | |
| open ios/Runner.xcworkspace |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment