@@ -5,32 +5,34 @@ TARGET_DIR="target"
55PROJECT_DIR=" ldk-node-jvm"
66JVM_LIB_DIR=" $BINDINGS_DIR /$PROJECT_DIR "
77
8- # Install gobley-uniffi-bindgen from fork with patched version
9- echo " Installing gobley-uniffi-bindgen fork..."
10- cargo install --git https://github.com/ovitrif/gobley.git --branch fix-v0.2.0 gobley-uniffi-bindgen --force
8+ # Install gobley-uniffi-bindgen from fork (skip if orchestrator already installed it)
9+ if [ -z " ${BINDGEN_GOBLEY_INSTALLED:- } " ]; then
10+ echo " Installing gobley-uniffi-bindgen fork..."
11+ cargo install --git https://github.com/ovitrif/gobley.git --branch fix-v0.2.0 gobley-uniffi-bindgen --force
12+ fi
1113UNIFFI_BINDGEN_BIN=" gobley-uniffi-bindgen"
1214
1315if [[ " $OSTYPE " == " linux-gnu" * ]]; then
1416 echo " Building for Linux x86_64..."
1517 rustup target add x86_64-unknown-linux-gnu || exit 1
16- cargo build --release --target x86_64-unknown-linux-gnu --features uniffi || exit 1
17- DYNAMIC_LIB_PATH=" $TARGET_DIR /x86_64-unknown-linux-gnu/release/libldk_node.so"
18+ cargo build --profile release-smaller --target x86_64-unknown-linux-gnu --features uniffi || exit 1
19+ DYNAMIC_LIB_PATH=" $TARGET_DIR /x86_64-unknown-linux-gnu/release-smaller /libldk_node.so"
1820 RES_DIR=" $JVM_LIB_DIR /lib/src/main/resources/linux-x86-64/"
1921 mkdir -p $RES_DIR || exit 1
2022 cp $DYNAMIC_LIB_PATH $RES_DIR || exit 1
2123else
2224 echo " Building for macOS x86_64..."
2325 rustup target add x86_64-apple-darwin || exit 1
24- cargo build --release --target x86_64-apple-darwin --features uniffi || exit 1
25- DYNAMIC_LIB_PATH=" $TARGET_DIR /x86_64-apple-darwin/release/libldk_node.dylib"
26+ cargo build --profile release-smaller --target x86_64-apple-darwin --features uniffi || exit 1
27+ DYNAMIC_LIB_PATH=" $TARGET_DIR /x86_64-apple-darwin/release-smaller /libldk_node.dylib"
2628 RES_DIR=" $JVM_LIB_DIR /lib/src/main/resources/darwin-x86-64/"
2729 mkdir -p $RES_DIR || exit 1
2830 cp $DYNAMIC_LIB_PATH $RES_DIR || exit 1
2931
3032 echo " Building for macOS aarch64..."
3133 rustup target add aarch64-apple-darwin || exit 1
32- cargo build --release --target aarch64-apple-darwin --features uniffi || exit 1
33- DYNAMIC_LIB_PATH_ARM=" $TARGET_DIR /aarch64-apple-darwin/release/libldk_node.dylib"
34+ cargo build --profile release-smaller --target aarch64-apple-darwin --features uniffi || exit 1
35+ DYNAMIC_LIB_PATH_ARM=" $TARGET_DIR /aarch64-apple-darwin/release-smaller /libldk_node.dylib"
3436 RES_DIR=" $JVM_LIB_DIR /lib/src/main/resources/darwin-aarch64/"
3537 mkdir -p $RES_DIR || exit 1
3638 cp $DYNAMIC_LIB_PATH_ARM $RES_DIR || exit 1
0 commit comments