From 68dea8b2589179928b7dd09b9fee51f7ab8298dd Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Fri, 28 Jan 2022 23:34:33 -0600 Subject: [PATCH 1/5] Update build.sh to support building mac aarch64 (m1) targets, update bdk-ffi --- README.md | 14 +++++++++++--- bdk-ffi | 2 +- build.sh | 13 ++++++++----- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 232208e..21e96ae 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,9 @@ repositories { dependencies { // for jvm - implementation 'org.bitcoindevkit:bdk-jvm:0.2.0' + implementation 'org.bitcoindevkit:bdk-jvm:0.3.0' // OR for android - implementation 'org.bitcoindevkit:bdk-android:0.2.0' + implementation 'org.bitcoindevkit:bdk-android:0.3.0' } @@ -52,7 +52,7 @@ val newAddress = wallet.getNewAddress() * [tatooine](https://github.com/thunderbiscuit/tatooine) -## How to build +### How to build 1. Clone this repository and init and update it's [`bdk-ffi`] submodule. ```shell @@ -60,6 +60,10 @@ val newAddress = wallet.getNewAddress() git submodule update --init ``` 1. Follow the "General" bdk-ffi ["Getting Started (Developer)"] instructions. +1. If building on MacOS install required intel and m1 jvm targets + ```sh + rustup target add x86_64-apple-darwin aarch64-apple-darwin + ``` 1. Install required targets ```sh rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android @@ -75,6 +79,10 @@ val newAddress = wallet.getNewAddress() ```sh ./build.sh ``` +1. Start android emulator and run tests + ```sh + ./gradlew connectedAndroidTest + ``` ## How to publish diff --git a/bdk-ffi b/bdk-ffi index e4d53b5..4cc183b 160000 --- a/bdk-ffi +++ b/bdk-ffi @@ -1 +1 @@ -Subproject commit e4d53b5e4b213e484bf4b76a4bf33884dd68f086 +Subproject commit 4cc183bef5eeb62e8b79a445ccca60ddf66e68d4 diff --git a/build.sh b/build.sh index 4ab1677..31a673c 100755 --- a/build.sh +++ b/build.sh @@ -4,20 +4,23 @@ set -eo pipefail echo "Build and test bdk-ffi library for local platform (darwin or linux)" pushd bdk-ffi -cargo fmt -cargo build --release -cargo test - OS=$(uname) echo -n "Copy " case $OS in "Darwin") echo -n "darwin " + # x86_64 (intel) + cargo build --release --target x86_64-apple-darwin mkdir -p ../jvm/src/main/resources/darwin-x86-64 - cp target/release/libbdkffi.dylib ../jvm/src/main/resources/darwin-x86-64 + cp target/x86_64-apple-darwin/release/libbdkffi.dylib ../jvm/src/main/resources/darwin-x86-64 + # aarch64 (m1) + cargo build --release --target aarch64-apple-darwin + mkdir -p ../jvm/src/main/resources/darwin-arm64 + cp target/aarch64-apple-darwin/release/libbdkffi.dylib ../jvm/src/main/resources/darwin-arm64 ;; "Linux") echo -n "linux " + cargo build --release mkdir -p ../jvm/src/main/resources/linux-x86-64 cp target/release/libbdkffi.so ../jvm/src/main/resources/linux-x86-64 ;; From 7b060f2e7e6c89f9a75d429e85c6be27af336c8b Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Fri, 28 Jan 2022 23:35:43 -0600 Subject: [PATCH 2/5] Bump android and jvm versions to 0.3.0 --- android/build.gradle | 2 +- jvm/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index eddc329..5e8131e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -49,7 +49,7 @@ afterEvaluate { // You can then customize attributes of the publication as shown below. groupId = 'org.bitcoindevkit' artifactId = 'bdk-android' - version = '0.2.2' + version = '0.3.0' pom { name = 'bdk-android' diff --git a/jvm/build.gradle b/jvm/build.gradle index c0a8c15..218ca30 100644 --- a/jvm/build.gradle +++ b/jvm/build.gradle @@ -38,7 +38,7 @@ afterEvaluate { groupId = 'org.bitcoindevkit' artifactId = 'bdk-jvm' - version = '0.2.2' + version = '0.3.0' pom { name = 'bdk-jvm' From 438f05a39a894a9578e920875eb2504b48b942b2 Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Sun, 30 Jan 2022 21:25:25 -0600 Subject: [PATCH 3/5] Bump jvm and android versions to 0.3.1 --- README.md | 4 ++-- android/build.gradle | 2 +- jvm/build.gradle | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 21e96ae..61d82cd 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,9 @@ repositories { dependencies { // for jvm - implementation 'org.bitcoindevkit:bdk-jvm:0.3.0' + implementation 'org.bitcoindevkit:bdk-jvm:0.3.1' // OR for android - implementation 'org.bitcoindevkit:bdk-android:0.3.0' + implementation 'org.bitcoindevkit:bdk-android:0.3.1' } diff --git a/android/build.gradle b/android/build.gradle index 5e8131e..9a671bc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -49,7 +49,7 @@ afterEvaluate { // You can then customize attributes of the publication as shown below. groupId = 'org.bitcoindevkit' artifactId = 'bdk-android' - version = '0.3.0' + version = '0.3.1' pom { name = 'bdk-android' diff --git a/jvm/build.gradle b/jvm/build.gradle index 218ca30..c36c3c2 100644 --- a/jvm/build.gradle +++ b/jvm/build.gradle @@ -38,7 +38,7 @@ afterEvaluate { groupId = 'org.bitcoindevkit' artifactId = 'bdk-jvm' - version = '0.3.0' + version = '0.3.1' pom { name = 'bdk-jvm' From f601a17daa88e701003d98f5f2322ca947285b0c Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Thu, 3 Feb 2022 19:39:13 -0600 Subject: [PATCH 4/5] Fix jvm darwin-aarch64 jpa resources path --- build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 31a673c..577e26f 100755 --- a/build.sh +++ b/build.sh @@ -15,8 +15,8 @@ case $OS in cp target/x86_64-apple-darwin/release/libbdkffi.dylib ../jvm/src/main/resources/darwin-x86-64 # aarch64 (m1) cargo build --release --target aarch64-apple-darwin - mkdir -p ../jvm/src/main/resources/darwin-arm64 - cp target/aarch64-apple-darwin/release/libbdkffi.dylib ../jvm/src/main/resources/darwin-arm64 + mkdir -p ../jvm/src/main/resources/darwin-aarch64 + cp target/aarch64-apple-darwin/release/libbdkffi.dylib ../jvm/src/main/resources/darwin-aarch64 ;; "Linux") echo -n "linux " From 530031e088c0d1630f668a0941e5db095a3512eb Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Thu, 3 Feb 2022 20:02:28 -0600 Subject: [PATCH 5/5] Bump jvm and android versions to 0.3.2 --- README.md | 4 ++-- android/build.gradle | 2 +- jvm/build.gradle | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 61d82cd..34b1829 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,9 @@ repositories { dependencies { // for jvm - implementation 'org.bitcoindevkit:bdk-jvm:0.3.1' + implementation 'org.bitcoindevkit:bdk-jvm:0.3.2' // OR for android - implementation 'org.bitcoindevkit:bdk-android:0.3.1' + implementation 'org.bitcoindevkit:bdk-android:0.3.2' } diff --git a/android/build.gradle b/android/build.gradle index 9a671bc..1aa8619 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -49,7 +49,7 @@ afterEvaluate { // You can then customize attributes of the publication as shown below. groupId = 'org.bitcoindevkit' artifactId = 'bdk-android' - version = '0.3.1' + version = '0.3.2' pom { name = 'bdk-android' diff --git a/jvm/build.gradle b/jvm/build.gradle index c36c3c2..34b8073 100644 --- a/jvm/build.gradle +++ b/jvm/build.gradle @@ -38,7 +38,7 @@ afterEvaluate { groupId = 'org.bitcoindevkit' artifactId = 'bdk-jvm' - version = '0.3.1' + version = '0.3.2' pom { name = 'bdk-jvm'