-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (53 loc) · 2.19 KB
/
Makefile
File metadata and controls
69 lines (53 loc) · 2.19 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
# Build targets for Meteograph
FLUTTER := ~/git/flutter/bin/flutter
# Version from git tag (e.g., v1.0.1 -> 1.0.1), fallback to 0.0.0
VERSION_NAME := $(shell git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.0.0")
# Build number from commit count (always incrementing)
VERSION_CODE := $(shell git rev-list --count HEAD)
.PHONY: debug release release-all release-split bundle install install-debug clean version test test-dart test-kotlin analyze
# Generate version.dart from git info (tag or commit hash)
version:
@./scripts/generate_version.sh
# Debug build (x86_64 only for emulator)
debug: version
$(FLUTTER) build apk --debug --target-platform android-x64
# Release build (arm64 only, ~19 MB)
release: version
@echo "Building version $(VERSION_NAME)+$(VERSION_CODE)"
$(FLUTTER) build apk --release --target-platform android-arm64 \
--build-name=$(VERSION_NAME) --build-number=$(VERSION_CODE)
# Release build with all architectures (~52 MB)
release-all: version
@echo "Building version $(VERSION_NAME)+$(VERSION_CODE)"
$(FLUTTER) build apk --release \
--build-name=$(VERSION_NAME) --build-number=$(VERSION_CODE)
# Split APKs by architecture (for manual distribution)
release-split: version
@echo "Building version $(VERSION_NAME)+$(VERSION_CODE)"
$(FLUTTER) build apk --release --split-per-abi \
--build-name=$(VERSION_NAME) --build-number=$(VERSION_CODE)
# App Bundle for Play Store (Google optimizes delivery)
bundle: version
@echo "Building version $(VERSION_NAME)+$(VERSION_CODE)"
$(FLUTTER) build appbundle --release \
--build-name=$(VERSION_NAME) --build-number=$(VERSION_CODE)
# Install release APK on connected device
install: release
adb install -r build/app/outputs/flutter-apk/app-release.apk
# Install debug APK on connected device
install-debug: debug
adb install -r build/app/outputs/flutter-apk/app-debug.apk
# Clean build artifacts
clean:
$(FLUTTER) clean
# Run all tests (Dart + Kotlin)
test: test-dart test-kotlin
# Run Dart/Flutter tests only
test-dart:
$(FLUTTER) test
# Run Kotlin unit tests only (requires JDK 17+, set JAVA_HOME if needed)
test-kotlin:
cd android && ./gradlew :app:test --console=plain
# Run Flutter analyzer
analyze:
$(FLUTTER) analyze