Skip to content

Commit

Permalink
refactor: use shell scripts to build bdk-jvm
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderbiscuit committed Aug 16, 2024
1 parent 3454331 commit 841de45
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bdk-jvm/scripts/build-linux-x86_64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Move to the Rust library directory
cd ../bdk-ffi/ || exit

# Build the Rust library
rustup default 1.77.1
rustup target add x86_64-unknown-linux-gnu
cargo build --profile release-smaller --target x86_64-unknown-linux-gnu

# Generate Kotlin bindings using uniffi-bindgen
cargo run --bin uniffi-bindgen generate --library ./target/aarch64-apple-darwin/release-smaller/libbdkffi.dylib --language kotlin --out-dir ../bdk-jvm/lib/src/main/kotlin/ --no-format

# Copy the binary to the resources directory
cp ./target/aarch64-apple-darwin/release-smaller/libbdkffi.dylib ../bdk-jvm/lib/src/main/resources/darwin-aarch64/libbdkffi.dylib
15 changes: 15 additions & 0 deletions bdk-jvm/scripts/build-macos-aarch64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Move to the Rust library directory
cd ../bdk-ffi/ || exit

# Build the Rust library
rustup default 1.77.1
rustup target add aarch64-apple-darwin
cargo build --profile release-smaller --target aarch64-apple-darwin

# Generate Kotlin bindings using uniffi-bindgen
cargo run --bin uniffi-bindgen generate --library ./target/aarch64-apple-darwin/release-smaller/libbdkffi.dylib --language kotlin --out-dir ../bdk-jvm/lib/src/main/kotlin/ --no-format

# Copy the binary to the resources directory
cp ./target/aarch64-apple-darwin/release-smaller/libbdkffi.dylib ../bdk-jvm/lib/src/main/resources/darwin-aarch64/libbdkffi.dylib
15 changes: 15 additions & 0 deletions bdk-jvm/scripts/build-macos-x86_64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Move to the Rust library directory
cd ../bdk-ffi/ || exit

# Build the Rust library
rustup default 1.77.1
rustup target add x86_64-apple-darwin
cargo build --profile release-smaller --target x86_64-apple-darwin

# Generate Kotlin bindings using uniffi-bindgen
cargo run --bin uniffi-bindgen generate --library ./target/x86_64-apple-darwin/release-smaller/libbdkffi.dylib --language kotlin --out-dir ../bdk-jvm/lib/src/main/kotlin/ --no-format

# Copy the binary to the resources directory
cp ./target/x86_64-apple-darwin/release-smaller/libbdkffi.dylib ../bdk-jvm/lib/src/main/resources/darwin-x86_64/libbdkffi.dylib
15 changes: 15 additions & 0 deletions bdk-jvm/scripts/build-windows-x86_64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Move to the Rust library directory
cd ../bdk-ffi/ || exit

# Build the Rust library
rustup default 1.77.1
rustup target add x86_64-unknown-linux-gnu
cargo build --profile release-smaller --target x86_64-unknown-linux-gnu

# Generate Kotlin bindings using uniffi-bindgen
cargo run --bin uniffi-bindgen generate --library ./target/aarch64-apple-darwin/release-smaller/libbdkffi.dylib --language kotlin --out-dir ../bdk-jvm/lib/src/main/kotlin/ --no-format

# Copy the binary to the resources directory
cp ./target/aarch64-apple-darwin/release-smaller/libbdkffi.dylib ../bdk-jvm/lib/src/main/resources/darwin-aarch64/libbdkffi.dylib

0 comments on commit 841de45

Please sign in to comment.