Update build.sh to support building mac aarch64 (m1) targets, update bdk-ffi
This commit is contained in:
parent
9bb629d0a8
commit
68dea8b258
14
README.md
14
README.md
@ -16,9 +16,9 @@ repositories {
|
|||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
// for jvm
|
// for jvm
|
||||||
implementation 'org.bitcoindevkit:bdk-jvm:0.2.0'
|
implementation 'org.bitcoindevkit:bdk-jvm:0.3.0'
|
||||||
// OR for android
|
// 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)
|
* [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.
|
1. Clone this repository and init and update it's [`bdk-ffi`] submodule.
|
||||||
```shell
|
```shell
|
||||||
@ -60,6 +60,10 @@ val newAddress = wallet.getNewAddress()
|
|||||||
git submodule update --init
|
git submodule update --init
|
||||||
```
|
```
|
||||||
1. Follow the "General" bdk-ffi ["Getting Started (Developer)"] instructions.
|
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
|
1. Install required targets
|
||||||
```sh
|
```sh
|
||||||
rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android
|
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
|
```sh
|
||||||
./build.sh
|
./build.sh
|
||||||
```
|
```
|
||||||
|
1. Start android emulator and run tests
|
||||||
|
```sh
|
||||||
|
./gradlew connectedAndroidTest
|
||||||
|
```
|
||||||
|
|
||||||
## How to publish
|
## How to publish
|
||||||
|
|
||||||
|
2
bdk-ffi
2
bdk-ffi
@ -1 +1 @@
|
|||||||
Subproject commit e4d53b5e4b213e484bf4b76a4bf33884dd68f086
|
Subproject commit 4cc183bef5eeb62e8b79a445ccca60ddf66e68d4
|
13
build.sh
13
build.sh
@ -4,20 +4,23 @@ set -eo pipefail
|
|||||||
echo "Build and test bdk-ffi library for local platform (darwin or linux)"
|
echo "Build and test bdk-ffi library for local platform (darwin or linux)"
|
||||||
pushd bdk-ffi
|
pushd bdk-ffi
|
||||||
|
|
||||||
cargo fmt
|
|
||||||
cargo build --release
|
|
||||||
cargo test
|
|
||||||
|
|
||||||
OS=$(uname)
|
OS=$(uname)
|
||||||
echo -n "Copy "
|
echo -n "Copy "
|
||||||
case $OS in
|
case $OS in
|
||||||
"Darwin")
|
"Darwin")
|
||||||
echo -n "darwin "
|
echo -n "darwin "
|
||||||
|
# x86_64 (intel)
|
||||||
|
cargo build --release --target x86_64-apple-darwin
|
||||||
mkdir -p ../jvm/src/main/resources/darwin-x86-64
|
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")
|
"Linux")
|
||||||
echo -n "linux "
|
echo -n "linux "
|
||||||
|
cargo build --release
|
||||||
mkdir -p ../jvm/src/main/resources/linux-x86-64
|
mkdir -p ../jvm/src/main/resources/linux-x86-64
|
||||||
cp target/release/libbdkffi.so ../jvm/src/main/resources/linux-x86-64
|
cp target/release/libbdkffi.so ../jvm/src/main/resources/linux-x86-64
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user