-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
166 lines (142 loc) Β· 4.39 KB
/
Copy pathMakefile
File metadata and controls
166 lines (142 loc) Β· 4.39 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
158
159
160
161
162
163
164
165
166
.PHONY: help setup format lint analyze test test-coverage build-runner clean build-ios build-ios-ipa build-android build-macos build-web run run-ios run-android run-web doctor icons
# Default target
help:
@echo "Counta - Mantra Counter App"
@echo ""
@echo "Available commands:"
@echo " make setup - Install dependencies and generate code"
@echo " make format - Format all Dart code"
@echo " make lint - Run linter (dart analyze)"
@echo " make analyze - Run static analysis"
@echo " make test - Run all unit tests"
@echo " make test-coverage - Run tests with coverage report"
@echo " make build-runner - Generate code for Hive models"
@echo " make clean - Clean build artifacts"
@echo ""
@echo "Build commands:"
@echo " make build-ios - Build iOS app (debug/ad-hoc)"
@echo " make build-ios-ipa - Build iOS archive for App Store/TestFlight"
@echo " make build-android - Build Android APK"
@echo " make build-macos - Build macOS app"
@echo " make build-web - Build web app"
@echo ""
@echo "Run commands:"
@echo " make run - Run app (default device)"
@echo " make run-ios - Run on iOS"
@echo " make run-android - Run on Android"
@echo " make run-web - Run on Chrome"
@echo ""
@echo "Asset commands:"
@echo " make icons - Generate app icons from assets/icon/app_icon.png"
@echo ""
@echo "Other commands:"
@echo " make doctor - Check Flutter environment"
# Setup project
setup:
@echo "π¦ Installing dependencies..."
flutter pub get
@echo "π§ Generating Hive adapters..."
dart run build_runner build --delete-conflicting-outputs
@echo "β
Setup complete!"
# Format code
format:
@echo "π¨ Formatting Dart code..."
dart format .
@echo "β
Formatting complete!"
# Lint code
lint:
@echo "π Running linter..."
dart analyze
@echo "β
Linting complete!"
# Analyze code
analyze:
@echo "π Running static analysis..."
flutter analyze
@echo "β
Analysis complete!"
# Run tests
test:
@echo "π§ͺ Running tests..."
flutter test
@echo "β
Tests complete!"
# Run tests with coverage
test-coverage:
@echo "π§ͺ Running tests with coverage..."
flutter test --coverage
@echo "π Generating coverage report..."
genhtml coverage/lcov.info -o coverage/html
@echo "β
Coverage report generated at coverage/html/index.html"
# Generate code (Hive adapters)
build-runner:
@echo "π§ Generating code..."
dart run build_runner build --delete-conflicting-outputs
@echo "β
Code generation complete!"
# Watch and regenerate code on changes
build-runner-watch:
@echo "π Watching for changes..."
dart run build_runner watch --delete-conflicting-outputs
# Clean build artifacts
clean:
@echo "π§Ή Cleaning build artifacts..."
flutter clean
@echo "β
Clean complete!"
# Build for iOS
build-ios:
@echo "π Building iOS app..."
flutter build ios
@echo "β
iOS build complete!"
# Build iOS archive (.ipa) for App Store / TestFlight
build-ios-ipa:
@echo "π Building iOS archive..."
flutter build ipa
@echo "β
iOS archive ready at build/ios/archive/Runner.xcarchive"
@echo " Upload via Xcode Organizer: open build/ios/archive/Runner.xcarchive"
# Build for Android
build-android:
@echo "π€ Building Android APK..."
flutter build apk
@echo "β
Android build complete!"
# Build for macOS
build-macos:
@echo "π» Building macOS app..."
flutter build macos
@echo "β
macOS build complete!"
# Build for Web
build-web:
@echo "π Building web app..."
flutter build web
@echo "β
Web build complete!"
# Run on default device
run:
@echo "π Running app..."
flutter run
# Run on iOS
run-ios:
@echo "π Running on iOS..."
flutter run -d ios
# Run on Android
run-android:
@echo "π€ Running on Android..."
flutter run -d android
# Run on Web (Chrome)
run-web:
@echo "π Running on Chrome..."
flutter run -d chrome
# Run on macOS
run-macos:
@echo "π» Running on macOS..."
flutter run -d macos
# Generate app icons from assets/icon/app_icon.png
icons:
@echo "πΌοΈ Generating app icons from assets/icon/app_icon.png..."
dart run flutter_launcher_icons
@echo "β
App icons generated!"
# Check Flutter environment
doctor:
@echo "π©Ί Checking Flutter environment..."
flutter doctor -v
# Full check (format, lint, test)
check: format lint test
@echo "β
All checks passed!"
# Prepare for commit
pre-commit: format lint test
@echo "β
Ready to commit!"