Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bdk-android/scripts/dev/build-dev-macos-aarch64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ mkdir -p ../bdk-android/lib/src/main/jniLibs/$RESOURCE_DIR_ARM64_V8A/
cp ./target/$COMPILATION_TARGET_ARM64_V8A/debug/$LIB_NAME ../bdk-android/lib/src/main/jniLibs/$RESOURCE_DIR_ARM64_V8A/

# Generate Kotlin bindings using uniffi-bindgen
cargo run --locked --bin uniffi-bindgen generate --library ./target/$COMPILATION_TARGET_ARM64_V8A/debug/$LIB_NAME --language kotlin --out-dir ../bdk-android/lib/src/main/kotlin/ --no-format
cargo run --locked --features uniffi-bindgen --bin uniffi-bindgen generate --library ./target/$COMPILATION_TARGET_ARM64_V8A/debug/$LIB_NAME --language kotlin --out-dir ../bdk-android/lib/src/main/kotlin/ --no-format
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ cp ./target/$COMPILATION_TARGET_ARMEABI_V7A/release-smaller/$LIB_NAME ../bdk-and
cp ./target/$COMPILATION_TARGET_X86_64/release-smaller/$LIB_NAME ../bdk-android/lib/src/main/jniLibs/$RESOURCE_DIR_X86_64/

# Generate Kotlin bindings using uniffi-bindgen
cargo run --locked --bin uniffi-bindgen generate --library ./target/$COMPILATION_TARGET_ARM64_V8A/release-smaller/$LIB_NAME --language kotlin --out-dir ../bdk-android/lib/src/main/kotlin/ --no-format
cargo run --locked --features uniffi-bindgen --bin uniffi-bindgen generate --library ./target/$COMPILATION_TARGET_ARM64_V8A/release-smaller/$LIB_NAME --language kotlin --out-dir ../bdk-android/lib/src/main/kotlin/ --no-format
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ cp ./target/$COMPILATION_TARGET_ARMEABI_V7A/release-smaller/$LIB_NAME ../bdk-and
cp ./target/$COMPILATION_TARGET_X86_64/release-smaller/$LIB_NAME ../bdk-android/lib/src/main/jniLibs/$RESOURCE_DIR_X86_64/

# Generate Kotlin bindings using uniffi-bindgen
cargo run --locked --bin uniffi-bindgen generate --library ./target/$COMPILATION_TARGET_ARM64_V8A/release-smaller/$LIB_NAME --language kotlin --out-dir ../bdk-android/lib/src/main/kotlin/ --no-format
cargo run --locked --features uniffi-bindgen --bin uniffi-bindgen generate --library ./target/$COMPILATION_TARGET_ARM64_V8A/release-smaller/$LIB_NAME --language kotlin --out-dir ../bdk-android/lib/src/main/kotlin/ --no-format
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ cp ./target/$COMPILATION_TARGET_ARMEABI_V7A/release-smaller/$LIB_NAME ../bdk-and
cp ./target/$COMPILATION_TARGET_X86_64/release-smaller/$LIB_NAME ../bdk-android/lib/src/main/jniLibs/$RESOURCE_DIR_X86_64/

# Generate Kotlin bindings using uniffi-bindgen. (Any of the other $COMPILATION_TARGET_* could have been used)
cargo run --locked --bin uniffi-bindgen generate --library ./target/$COMPILATION_TARGET_ARM64_V8A/release-smaller/$LIB_NAME --language kotlin --out-dir ../bdk-android/lib/src/main/kotlin/ --no-format
cargo run --locked --features uniffi-bindgen --bin uniffi-bindgen generate --library ./target/$COMPILATION_TARGET_ARM64_V8A/release-smaller/$LIB_NAME --language kotlin --out-dir ../bdk-android/lib/src/main/kotlin/ --no-format
7 changes: 6 additions & 1 deletion bdk-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ version = "3.2.0-alpha.0"
homepage = "https://bitcoindevkit.org"
repository = "https://github.com/bitcoindevkit/bdk"
edition = "2018"
resolver = "2"
license = "MIT OR Apache-2.0"

[lib]
Expand All @@ -13,14 +14,18 @@ name = "bdkffi"
[[bin]]
name = "uniffi-bindgen"
path = "uniffi-bindgen.rs"
required-features = ["uniffi-bindgen"]

[features]
uniffi-bindgen = ["uniffi/cli"]

[dependencies]
bdk_wallet = { version = "=3.2.0", features = ["all-keys", "keys-bip39", "rusqlite"] }
bdk_esplora = { version = "0.22.3", default-features = false, features = ["std", "blocking", "blocking-https-rustls"] }
bdk_electrum = { version = "0.24.1", default-features = false, features = ["use-rustls-ring"] }
bdk_kyoto = { version = "0.17.1" }

uniffi = { version = "=0.31.2", features = ["cli"]}
uniffi = { version = "=0.31.2"}
thiserror = "2.0.17"

[build-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions bdk-swift/build-xcframework-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ cargo build --locked --package bdk-ffi --target "$IOS_SIM_TARGET"
cargo build --locked --package bdk-ffi --target "$IOS_DEVICE_TARGET"

UNIFFI_LIBRARY_PATH="./target/$IOS_DEVICE_TARGET/$PROFILE_DIR/lib${NAME}.dylib"
cargo run --locked --bin uniffi-bindgen generate \
cargo run --locked --features uniffi-bindgen --bin uniffi-bindgen generate \
--library "${UNIFFI_LIBRARY_PATH}" \
--language swift \
--out-dir "${SWIFT_OUT_DIR}" \
Expand All @@ -49,7 +49,7 @@ cargo run --locked --bin uniffi-bindgen generate \
rm -rf "${NEW_HEADER_DIR:?}"/*
rm -rf "${HEADER_OUT_DIR:?}"
mkdir -p "${HEADER_OUT_DIR}"
cargo run --locked --bin uniffi-bindgen generate \
cargo run --locked --features uniffi-bindgen --bin uniffi-bindgen generate \
--library "${UNIFFI_LIBRARY_PATH}" \
--language swift \
--out-dir "${HEADER_OUT_DIR}" \
Expand Down
4 changes: 2 additions & 2 deletions bdk-swift/build-xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ cargo build --locked --package bdk-ffi --profile release-smaller --target aarch6

# build bdk-ffi Swift bindings and put in bdk-swift Sources
UNIFFI_LIBRARY_PATH="./target/aarch64-apple-ios/${RELDIR}/lib${NAME}.dylib"
cargo run --locked --bin uniffi-bindgen generate --library "${UNIFFI_LIBRARY_PATH}" --language swift --out-dir "${SWIFT_OUT_DIR}" --no-format
cargo run --locked --features uniffi-bindgen --bin uniffi-bindgen generate --library "${UNIFFI_LIBRARY_PATH}" --language swift --out-dir "${SWIFT_OUT_DIR}" --no-format

# Final xcframework structure (per-arch):
# Headers/
Expand All @@ -45,7 +45,7 @@ cargo run --locked --bin uniffi-bindgen generate --library "${UNIFFI_LIBRARY_PAT
rm -rf "${NEW_HEADER_DIR:?}"/*
rm -rf "${HEADER_OUT_DIR:?}"
mkdir -p "${HEADER_OUT_DIR}"
cargo run --locked --bin uniffi-bindgen generate --library "${UNIFFI_LIBRARY_PATH}" --language swift --out-dir "${HEADER_OUT_DIR}" --no-format
cargo run --locked --features uniffi-bindgen --bin uniffi-bindgen generate --library "${UNIFFI_LIBRARY_PATH}" --language swift --out-dir "${HEADER_OUT_DIR}" --no-format

# Keep the header output directory clean: xcframework headers should only contain .h + module.modulemap
find "${HEADER_OUT_DIR}" -maxdepth 1 -name '*.swift' -delete
Expand Down
Loading