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 .github/workflows/android-api-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: "Build Android API documentation"
run: |
cd ./bdk-android/
bash ./scripts/build-linux-x86_64.sh
bash ./scripts/release/build-release-linux-x86_64.sh
./gradlew dokkaHtml

- name: "Upload documentation website"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
java-version: 17

- name: "Build bdk-android library"
run: bash ./scripts/build-linux-x86_64.sh
run: bash ./scripts/release/build-release-linux-x86_64.sh

- name: "Publish to Maven Central"
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: "Build Android library"
run: |
cd bdk-android
bash ./scripts/build-linux-x86_64.sh
bash ./scripts/release/build-release-linux-x86_64.sh

- name: "Enable KVM"
run: |
Expand Down
7 changes: 6 additions & 1 deletion bdk-android/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ publish-local:
[group("Build")]
[doc("Build the library for given ARCH.")]
build ARCH="macos-aarch64":
bash ./scripts/build-{{ARCH}}.sh
bash ./scripts/release/build-release-{{ARCH}}.sh

[group("Build")]
[doc("Build the library for a single architecture in development mode.")]
build-dev:
bash ./scripts/dev/build-dev-macos-aarch64.sh

[group("Build")]
[doc("List available architectures for the build command.")]
Expand Down
28 changes: 28 additions & 0 deletions bdk-android/scripts/dev/build-dev-macos-aarch64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

if [ -z "$ANDROID_NDK_ROOT" ]; then
echo "Error: ANDROID_NDK_ROOT is not defined in your environment"
exit 1
fi

PATH="$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/darwin-x86_64/bin:$PATH"
CFLAGS="-D__ANDROID_MIN_SDK_VERSION__=24"
AR="llvm-ar"
LIB_NAME="libbdkffi.so"
COMPILATION_TARGET_ARM64_V8A="aarch64-linux-android"
RESOURCE_DIR_ARM64_V8A="arm64-v8a"

# Move to the Rust library directory
cd ../bdk-ffi/ || exit
rustup target add $COMPILATION_TARGET_ARM64_V8A

# Build the binaries
# The CC and CARGO_TARGET_<TARGET>_LINUX_ANDROID_LINKER environment variables must be declared on the same line as the cargo build command
CC="aarch64-linux-android24-clang" CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="aarch64-linux-android24-clang" cargo build --target $COMPILATION_TARGET_ARM64_V8A

# Copy the binaries to their respective resource directories
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 --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
3 changes: 3 additions & 0 deletions bdk-ffi/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ default:
build:
cargo build --profile release-smaller

build-dev:
cargo build

check:
cargo fmt
cargo clippy
Expand Down
Loading