-
Notifications
You must be signed in to change notification settings - Fork 271
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (41 loc) · 2.04 KB
/
Makefile
File metadata and controls
60 lines (41 loc) · 2.04 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
IOS_DEVICE_ID := $(shell xcrun xctrace list devices 2>/dev/null | grep -v Simulator | grep -E '\([0-9A-F-]+\)$$' | grep -v Mac | head -1 | grep -oE '[0-9A-F]{8}-[0-9A-F]{16}')
IOS_DERIVED_DATA := build/ios-derived-data
IOS_APP_PATH := $(IOS_DERIVED_DATA)/Build/Products/Debug-iphoneos/FareBot.app
IOS_SIM_APP_PATH := $(IOS_DERIVED_DATA)/Build/Products/Debug-iphonesimulator/FareBot.app
.PHONY: android android-install ios ios-sim ios-install desktop web web-run test clean help
## Android
android: ## Build Android debug APK
./gradlew :app:android:assembleDebug
android-install: android ## Build and install on connected Android device
adb install -r app/android/build/outputs/apk/debug/app-android-debug.apk
## iOS
ios: ## Build iOS app for physical device
./gradlew :app:linkDebugFrameworkIosArm64
xcodebuild -project app/ios/FareBot.xcodeproj -scheme FareBot \
-derivedDataPath $(IOS_DERIVED_DATA) \
-destination 'id=$(IOS_DEVICE_ID)' -allowProvisioningUpdates build
ios-sim: ## Build iOS app for simulator
./gradlew --no-daemon :app:linkDebugFrameworkIosSimulatorArm64
xcodebuild -project app/ios/FareBot.xcodeproj -scheme FareBot \
-derivedDataPath $(IOS_DERIVED_DATA) \
-destination 'platform=iOS Simulator,name=iPhone 16' build
ios-install: ios ## Build and install on connected iOS device
xcrun devicectl device install app --device $(IOS_DEVICE_ID) "$(IOS_APP_PATH)"
## Desktop
desktop: ## Run macOS desktop app (experimental)
./gradlew :app:desktop:runDistributable
## Web
web: ## Build web app (experimental, WebAssembly)
./gradlew :app:web:wasmJsBrowserDistribution
web-run: ## Run web app dev server with hot reload
./gradlew :app:web:wasmJsBrowserDevelopmentRun
## Tests
test: ## Run all tests
./gradlew allTests -x linkDebugTestIosSimulatorArm64 -x linkDebugTestIosX64
## Utility
clean: ## Clean all build artifacts
./gradlew clean
rm -rf $(IOS_DERIVED_DATA)
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help