@@ -5,19 +5,30 @@ PROJECT_DIR="ldk-node-jvm"
5
5
PACKAGE_DIR=" org/lightningdevkit/ldknode"
6
6
UNIFFI_BINDGEN_BIN=" cargo run --features=uniffi/cli --bin uniffi-bindgen"
7
7
8
- DYNAMIC_LIB_PATH=" target/release/libldk_node.dylib"
9
8
if [[ " $OSTYPE " == " linux-gnu" * ]]; then
10
- DYNAMIC_LIB_PATH=" target/release/libldk_node.so"
11
- fi
9
+ rustup target add x86_64-unknown-linux-gnu || exit 1
10
+ cargo build --release --target x86_64-unknown-linux-gnu --features uniffi || exit 1
11
+ DYNAMIC_LIB_PATH=" target/x86_64-unknown-linux-gnu/release/libldk_node.so"
12
+ RES_DIR=" $BINDINGS_DIR /$PROJECT_DIR /lib/src/main/resources/linux-x86-64/"
13
+ mkdir -p $RES_DIR || exit 1
14
+ cp $DYNAMIC_LIB_PATH $RES_DIR || exit 1
15
+ else
16
+ rustup target add x86_64-apple-darwin || exit 1
17
+ cargo build --release --target x86_64-apple-darwin --features uniffi || exit 1
18
+ DYNAMIC_LIB_PATH=" target/x86_64-apple-darwin/release/libldk_node.dylib"
19
+ RES_DIR=" $BINDINGS_DIR /$PROJECT_DIR /lib/src/main/resources/darwin-x86-64/"
20
+ mkdir -p $RES_DIR || exit 1
21
+ cp $DYNAMIC_LIB_PATH $RES_DIR || exit 1
12
22
13
- # rustup target add aarch64-apple-darwin
14
- # cargo build --target aarch64-apple-darwin || exit 1
15
- cargo build --release --features uniffi || exit 1
16
- $UNIFFI_BINDGEN_BIN generate bindings/ldk_node.udl --language kotlin -o " $TARGET_DIR " || exit 1
23
+ rustup target add aarch64-apple-darwin || exit 1
24
+ cargo build --release --target aarch64-apple-darwin --features uniffi || exit 1
25
+ DYNAMIC_LIB_PATH=" target/aarch64-apple-darwin/release/libldk_node.dylib"
26
+ RES_DIR=" $BINDINGS_DIR /$PROJECT_DIR /lib/src/main/resources/darwin-aarch64/"
27
+ mkdir -p $RES_DIR || exit 1
28
+ cp $DYNAMIC_LIB_PATH $RES_DIR || exit 1
29
+ fi
17
30
18
31
mkdir -p " $BINDINGS_DIR " /" $PROJECT_DIR " /lib/src/main/kotlin/" $PACKAGE_DIR " || exit 1
19
- mkdir -p " $BINDINGS_DIR " / " $PROJECT_DIR " /lib/src/main/resources/darwin-aarch64/ || exit 1
32
+ $UNIFFI_BINDGEN_BIN generate bindings/ldk_node.udl --language kotlin -o " $TARGET_DIR " || exit 1
20
33
21
34
cp " $TARGET_DIR " /" $PACKAGE_DIR " /ldk_node.kt " $BINDINGS_DIR " /" $PROJECT_DIR " /lib/src/main/kotlin/" $PACKAGE_DIR " / || exit 1
22
- # cp ./target/aarch64-apple-darwin/debug/libldk_node.dylib "$BINDINGS_DIR"/"$PROJECT_DIR"/lib/src/main/resources/darwin-aarch64/libldk_node.dylib || exit 1
23
- cp $DYNAMIC_LIB_PATH " $BINDINGS_DIR " /" $PROJECT_DIR " /lib/src/main/resources/libldk_node.dylib || exit 1
0 commit comments