-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (47 loc) · 1.43 KB
/
Makefile
File metadata and controls
55 lines (47 loc) · 1.43 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
# === CONFIG ===
DART_DEFINE_FILE=env/secret_constant.json
FLUTTER=flutter
# === File globs to delete ===
GENERATED_GLOBS=\
"*.g.dart" \
"*.freezed.dart" \
"*.gr.dart" \
"*.chopper.dart" \
"*.mapper.dart" \
"*.config.dart" \
"lib/i18n/app_localizations.dart" \
"lib/i18n/app_localizations_en.dart" \
"lib/i18n/app_localizations_hi.dart"
# === TARGETS ===
# Clean Flutter and generated files
clean:
@echo "Cleaning Flutter build..."
$(FLUTTER) clean
@echo "Deleting generated files..."
@for pattern in $(GENERATED_GLOBS); do \
find lib -type f -name "$$pattern" -exec rm -v {} +; \
done
# Build codegen
build:
@echo "Running build_runner..."
$(FLUTTER) pub run build_runner build --delete-conflicting-outputs
# Run on macOS with config
run-macos:
@echo "Running app on macOS..."
$(FLUTTER) run -d macos --dart-define-from-file=$(DART_DEFINE_FILE)
# Run on Android emulator
run-android:
@echo "Running app on Android emulator..."
$(FLUTTER) run -d emulator-5554 --dart-define-from-file=$(DART_DEFINE_FILE)
# Remove local install
clean-macos:
rm -rf build/
rm -rf macos/Flutter/ephemeral
rm -rf /Applications/Weather.app
rm -rf ~/Library/Preferences/com.example.weather.plist
rm -rf ~/Library/Application\ Support/com.example.weather
rm -rf ~/Library/Containers/com.example.weather
rm -rf ~/Library/Caches/com.example.weather
# Combined pipelines
dev-macos: clean build run-macos
dev-android: clean build run-android