-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathjustfile
More file actions
98 lines (75 loc) · 2.84 KB
/
justfile
File metadata and controls
98 lines (75 loc) · 2.84 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
list:
just --list
bootstrap: install-rust install-toolchains install-ndk
install-rust:
@echo Install Rust
@cd ../core && just install-rust
install-toolchains:
@echo Install toolchains for uniffi
@cd ../core && just gemstone install-android-targets
install-typeshare:
@echo "==> Install typeshare-cli"
@cd ../core && just install-typeshare
install-ndk:
@cd ../core && just gemstone install-ndk
clean:
@./gradlew clean
build:
@./gradlew assembleGoogleDebug
run: build
@just _run-adb emulator
run-device: build
@just _run-adb device
_run-adb TARGET:
#!/usr/bin/env bash
set -euo pipefail
if [ "{{TARGET}}" = "emulator" ]; then
DEVICE=$(adb devices | awk '$2=="device" && $1 ~ /^emulator-/ {print $1; exit}')
[ -z "$DEVICE" ] && { echo "No emulator found (try 'just start-emulator')"; exit 1; }
else
DEVICE=$(adb devices | awk '$2=="device" && $1 !~ /^emulator-/ {print $1; exit}')
[ -z "$DEVICE" ] && { echo "No physical device found"; exit 1; }
fi
APK=$(find app/build/outputs/apk/google/debug -name '*.apk' | head -1)
echo "==> Installing on $DEVICE..."
adb -s "$DEVICE" install -r "$APK"
echo "==> Launching app..."
adb -s "$DEVICE" shell am start -n com.gemwallet.android/com.gemwallet.android.MainActivity
echo "==> Streaming logs (Ctrl+C to stop)..."
sleep 1
PID=$(adb -s "$DEVICE" shell pidof com.gemwallet.android)
if [ -z "$PID" ]; then
echo "App not running, showing unfiltered logcat"
adb -s "$DEVICE" logcat
else
adb -s "$DEVICE" logcat --pid="$PID"
fi
build-test:
@./gradlew assembleGoogleDebugAndroidTest
test:
@./gradlew testGoogleDebugUnitTest
test-integration:
@./gradlew connectedGoogleDebugAndroidTest
lint:
@./gradlew lint -x :gemstone:lintDebug
provision-emulator:
@bash ./scripts/android_emulator.sh provision
start-emulator:
@bash ./scripts/android_emulator.sh setup
stop-emulator:
@bash ./scripts/android_emulator.sh shutdown
mobsfscan:
@command -v uv >/dev/null || { \
echo "uv is not installed. Install it via 'curl -LsSf https://astral.sh/uv/install.sh | sh'."; \
exit 1; }
uv tool run mobsfscan -- --type android --config .mobsf --exit-warning
release:
@./gradlew clean :app:bundleGoogleRelease assembleUniversalRelease assembleHuaweiRelease assembleSolanaRelease assembleSamsungRelease --no-configuration-cache
localize:
@cd ../core && cargo run --package generate --bin generate localize android ../localization/app ../android/ui/src/main/res
generate: generate-models
generate-models: install-typeshare
@echo "==> Generate typeshare for Android"
@cd ../core && cargo run --package generate --bin generate android ../android/gemcore/src/main/kotlin/com/wallet/core
bump TARGET="patch":
@cd .. && just bump {{TARGET}}