-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathjustfile
More file actions
executable file
·39 lines (29 loc) · 1.43 KB
/
Copy pathjustfile
File metadata and controls
executable file
·39 lines (29 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
#!/usr/bin/env just --justfile
TARGET_SDK := "35"
ONDK_VERSION := "r29.5"
# https://developer.android.com/ndk/guides/other_build_systems#overview
HOST_TAG := (if os() == "macos" { "darwin" } else { os() }) + "-x86_64"
ONDK_PATH := env("ANDROID_HOME") / "ndk" / "ondk"
LLVM_BIN := ONDK_PATH / "toolchains/llvm/prebuilt" / HOST_TAG / "bin"
export CC := LLVM_BIN / ("aarch64-linux-android" + TARGET_SDK + "-clang")
build variant="debug" features="": setup-ondk
{{ if variant == "release" { "PROFILE=release" } else { "" } }} \
cargo build \
-Z build-std \
--target aarch64-linux-android \
--config target.aarch64-linux-android.linker=\"{{CC}}\" \
{{ if variant == "release" { "--release" } else { "" } }} \
{{ if features == "no-zygisk" { "--no-default-features" } else { "" } }}
deploy variant="debug": (build variant)
adb push target/aarch64-linux-android/{{variant}}/zynx /data/local/tmp/zynx
adb shell "chmod +x /data/local/tmp/zynx"
run-emulator variant="debug": (deploy variant)
adb shell "(su 0 killall zynx || true) && sleep 1"
adb shell su 0 setenforce 0
adb shell "RUST_LOG=debug RUST_LOG_STYLE=always RUST_BACKTRACE=1 su 0 /data/local/tmp/zynx --cfg-enable-zygisk --cfg-enable-debugger --cfg-enable-liteloader"
setup-ondk:
@python3 scripts/setup-ondk.py --version {{ONDK_VERSION}}
clippy: setup-ondk
cargo clippy --target aarch64-linux-android
clean:
cargo clean