forked from Mufanc/DexHunter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.toml
More file actions
40 lines (31 loc) · 872 Bytes
/
Copy pathMakefile.toml
File metadata and controls
40 lines (31 loc) · 872 Bytes
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
[env]
TARGET_ABI = { value = 'aarch64-linux-android', condition = { env_not_set = [ 'TARGET_ABI' ] }}
TARGET_SDK = '31'
DEPLOY_PATH = '/data/local/tmp/${CARGO_MAKE_PROJECT_NAME}'
ADB = 'adb'
[tasks.default]
alias = 'build'
[tasks.prepare]
script = '''
rm -rf .cargo
mkdir -p .cargo
cat << EOF > .cargo/config.toml
[build]
target = "$TARGET_ABI"
[target.$TARGET_ABI]
ar = "$(ls "$ANDROID_NDK"/toolchains/llvm/prebuilt/*/bin/llvm-ar | head -n 1)"
linker = "$(ls -r "$ANDROID_NDK"/toolchains/llvm/prebuilt/*/bin/"$TARGET_ABI"*-clang | head -n 1)"
EOF
'''
[tasks.build]
dependencies = [ 'prepare' ]
command = 'cargo'
args = [ 'build' ]
[tasks.release]
dependencies = [ 'prepare' ]
command = 'cargo'
args = [ 'build', '--release' ]
[tasks.upx-release]
dependencies = [ 'release' ]
command = 'upx'
args = [ './target/${TARGET_ABI}/release/${CARGO_MAKE_PROJECT_NAME}' ]