-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakeFile
More file actions
157 lines (130 loc) · 4.94 KB
/
MakeFile
File metadata and controls
157 lines (130 loc) · 4.94 KB
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
157
# Flutter Makefile
# This makefile contains common Flutter build and development commands
.PHONY: help clean get build-runner watch doctor analyze test build-apk build-apk-release build-apk-debug build-appbundle build-ios run upgrade format test-coverage deps clean-build build-ipa pod-install
# Default target - shows available commands
help:
@echo "📋 Available commands:"
@echo " make get - Get all dependencies (flutter pub get)"
@echo " make clean - Clean build files and cache"
@echo " make build-runner - Generate code using build_runner (one-time)"
@echo " make watch - Watch for changes and regenerate code automatically"
@echo " make doctor - Run flutter doctor to check environment"
@echo " make analyze - Analyze code for issues"
@echo " make format - Format code using dart format"
@echo " make test - Run all unit and widget tests"
@echo " make test-coverage - Generate test coverage report"
@echo " make deps - Check for outdated dependencies"
@echo " make build-apk - Build release APK"
@echo " make build-apk-debug - Build debug APK"
@echo " make build-apk-split - Build release APK with split per ABI"
@echo " make build-appbundle - Build Android App Bundle (AAB) for Play Store"
@echo " make build-ios - Build iOS app"
@echo " make build-ipa - Build iOS archive for App Store"
@echo " make pod-install - Install iOS pods"
@echo " make run - Run app in debug mode"
@echo " make run-release - Run app in release mode"
@echo " make upgrade - Upgrade all dependencies"
@echo " make clean-build - Clean, get deps, and run build_runner"
@echo " make outdated - Check for outdated packages (alias for deps)"
# Get all dependencies
get:
@echo "📦 Getting dependencies..."
flutter pub get
# Clean build files and cache
clean:
@echo "🧹 Cleaning build files..."
flutter clean
flutter pub get
# Run build_runner to generate code (one-time generation)
build-runner:
@echo "🔨 Running build_runner..."
flutter pub run build_runner build --delete-conflicting-outputs
# Watch mode - automatically regenerate code on changes
watch:
@echo "👀 Starting build_runner in watch mode..."
flutter pub run build_runner watch --delete-conflicting-outputs
# Check Flutter environment
doctor:
@echo "🏥 Running Flutter doctor..."
flutter doctor -v
# Analyze code for issues
analyze:
@echo "🔍 Analyzing code..."
flutter analyze
# Run tests
test:
@echo "🧪 Running tests..."
flutter test
# Build release APK (universal - works on all architectures)
build-apk:
@echo "📱 Building release APK..."
flutter build apk --release
# Build debug APK
build-apk-debug:
@echo "📱 Building debug APK..."
flutter build apk --debug
# Build split APKs per architecture (smaller file sizes)
build-apk-split:
@echo "📱 Building split APKs per ABI..."
flutter build apk --split-per-abi --release
# Build Android App Bundle for Play Store
build-appbundle:
@echo "📦 Building Android App Bundle..."
flutter build appbundle --release
# Build iOS app
build-ios:
@echo "🍎 Building iOS app..."
flutter build ios --release
# Run app in debug mode
run:
@echo "🚀 Running app in debug mode..."
flutter run
# Run app in release mode
run-release:
@echo "Running app in release mode..."
flutter run --release
# Format code
format:
@echo "Formatting code..."
flutter format .
# Generate test coverage report
test-coverage:
@echo "Generating test coverage report..."
flutter test --coverage
genhtml coverage/lcov.info -o coverage/html
@echo "Coverage report generated at: coverage/html/index.html"
# Check for outdated dependencies
deps:
@echo "Checking for outdated dependencies..."
flutter pub outdated
# Clean and rebuild everything
clean-build: clean get build-runner
# Build iOS archive for App Store
build-ipa:
@echo "Building iOS archive..."
cd ios && xcodebuild -workspace Runner.xcworkspace -scheme Runner -sdk iphonesimulator -configuration Debug -allowProvisioningUpdates
# Install iOS pods
pod-install:
@echo "Installing iOS pods..."
cd ios && pod install
# Upgrade all dependencies
upgrade:
@echo "Upgrading dependencies..."
flutter pub upgrade
# Alias for deps
outdated: deps
@echo "Checking for outdated packages..."
flutter pub outdated
# Clean, get dependencies, and run build_runner
rebuild: clean get build-runner
# Full build pipeline for development
dev-build: clean get build-runner analyze
@echo "✅ Development build complete!"
# Full build pipeline for release APK
release-apk: clean get build-runner analyze test build-apk
@echo "✅ Release APK build complete!"
@echo "📍 APK location: build/app/outputs/flutter-apk/app-release.apk"
# Full build pipeline for Play Store (AAB)
release-aab: clean get build-runner analyze test build-appbundle
@echo "✅ Release AAB build complete!"
@echo "📍 AAB location: build/app/outputs/bundle/release/app-release.aab"