File tree Expand file tree Collapse file tree 1 file changed +29
-3
lines changed Expand file tree Collapse file tree 1 file changed +29
-3
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
2+
23BINDINGS_DIR=" bindings/kotlin"
34TARGET_DIR=" target"
45PROJECT_DIR=" ldk-node-android"
5- PACKAGE_DIR=" org/lightningdevkit/ldknode"
66UNIFFI_BINDGEN_BIN=" cargo run --manifest-path bindings/uniffi-bindgen/Cargo.toml"
7- ANDROID_NDK_ROOT=" /opt/homebrew/share/android-ndk"
8- LLVM_ARCH_PATH=" darwin-x86_64"
7+
8+ export_variable_if_not_present () {
9+ local name=" $1 "
10+ local value=" $2 "
11+
12+ # Check if the variable is already set
13+ if [ -z " ${! name} " ]; then
14+ export " $name =$value "
15+ echo " Exported $name =$value "
16+ else
17+ echo " $name is already set to ${! name} , not exporting."
18+ fi
19+ }
20+
21+ case " $OSTYPE " in
22+ linux-gnu)
23+ export_variable_if_not_present " ANDROID_NDK_ROOT" " /opt/android-ndk"
24+ export_variable_if_not_present " LLVM_ARCH_PATH" " linux-x86_64"
25+ ;;
26+ darwin* )
27+ export_variable_if_not_present " ANDROID_NDK_ROOT" " /opt/homebrew/share/android-ndk"
28+ export_variable_if_not_present " LLVM_ARCH_PATH" " darwin-x86_64"
29+ ;;
30+ * )
31+ echo " Unknown operating system: $OSTYPE "
32+ ;;
33+ esac
34+
935PATH=" $ANDROID_NDK_ROOT /toolchains/llvm/prebuilt/$LLVM_ARCH_PATH /bin:$PATH "
1036
1137rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi
You can’t perform that action at this time.
0 commit comments