From 931461e10d5e347e0bbc9efe3cc0d878ec3d2249 Mon Sep 17 00:00:00 2001 From: Sudarsan Balaji Date: Fri, 5 Nov 2021 23:52:08 +0530 Subject: [PATCH 1/8] Ignore unnecessary files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 85429e1..14035e0 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ local.properties .DS_Store testdb xcuserdata +.lsp +.clj-kondo From dc7339a174cbe7e7a2506b17335355b028a3f0d9 Mon Sep 17 00:00:00 2001 From: Sudarsan Balaji Date: Sat, 6 Nov 2021 00:22:38 +0530 Subject: [PATCH 2/8] Add publish configuration --- bindings/bdk-kotlin/android/build.gradle | 27 ++++++++++-------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/bindings/bdk-kotlin/android/build.gradle b/bindings/bdk-kotlin/android/build.gradle index 06b71ac..c3637d3 100644 --- a/bindings/bdk-kotlin/android/build.gradle +++ b/bindings/bdk-kotlin/android/build.gradle @@ -1,6 +1,8 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'maven-publish' +group = 'org.bitcoindevkit' +version = '0.1.0' android { compileSdkVersion 30 @@ -26,25 +28,18 @@ android { afterEvaluate { publishing { - publications { - // Creates a Maven publication called "release". - release(MavenPublication) { - // Applies the component for the release build variant. - from components.release - // You can then customize attributes of the publication as shown below. - groupId = 'org.bitcoindevkit' - artifactId = 'bdk' - version = '0.0.1-SNAPSHOT' + repositories { + maven { + url myMavenRepoWriteUrl } - // Creates a Maven publication called “debug”. - debug(MavenPublication) { - // Applies the component for the debug build variant. - from components.debug + } - groupId = 'org.bitcoindevkit' - artifactId = 'bdk-debug' - version = '0.0.1-SNAPSHOT' + publications { + + maven(MavenPublication) { + from components.release + artifactId = 'bdk-android' } } } From cfde899b2cc47fbeff7dadcbc7e686ebb8830d32 Mon Sep 17 00:00:00 2001 From: Sudarsan Balaji Date: Sat, 6 Nov 2021 00:22:45 +0530 Subject: [PATCH 3/8] Add publish configuration --- bindings/bdk-kotlin/jvm/build.gradle | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bindings/bdk-kotlin/jvm/build.gradle b/bindings/bdk-kotlin/jvm/build.gradle index ea9408a..a0f754f 100644 --- a/bindings/bdk-kotlin/jvm/build.gradle +++ b/bindings/bdk-kotlin/jvm/build.gradle @@ -27,11 +27,18 @@ dependencies { } publishing { + + repositories { + maven { + url myMavenRepoWriteUrl + } + } + publications { maven(MavenPublication) { groupId = 'org.bitcoindevkit' artifactId = 'bdk' - version = '0.0.1-SNAPSHOT' + version = '0.1.0' from components.java } From fb3bfbde70f5be4f28c39645038a4f60136a6587 Mon Sep 17 00:00:00 2001 From: Sudarsan Balaji Date: Sat, 6 Nov 2021 00:22:58 +0530 Subject: [PATCH 4/8] Stop copying over i686 --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 160a105..8895558 100755 --- a/build.sh +++ b/build.sh @@ -118,7 +118,7 @@ build_android() { fi if echo $BUILD_TARGETS | grep "i686"; then CARGO_TARGET_I686_LINUX_ANDROID_LINKER="i686-linux-android21-clang" CC="i686-linux-android21-clang" cargo build --target=i686-linux-android - cp target/i686-linux-android/debug/libbdkffi.so bindings/bdk-kotlin/android/src/main/jniLibs/x86 + # cp target/i686-linux-android/debug/libbdkffi.so bindings/bdk-kotlin/android/src/main/jniLibs/x86 fi # copy sources From a4e32e783311d8cac0cecf883ac15ce99d59fe6c Mon Sep 17 00:00:00 2001 From: Sudarsan Balaji Date: Sat, 6 Nov 2021 00:23:06 +0530 Subject: [PATCH 5/8] Stop publishing on build --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 8895558..3ab3071 100755 --- a/build.sh +++ b/build.sh @@ -125,7 +125,7 @@ build_android() { cp -R bindings/bdk-kotlin/jvm/src/main/kotlin bindings/bdk-kotlin/android/src/main # bdk-kotlin aar - (cd bindings/bdk-kotlin && ./gradlew :android:build && ./gradlew :android:publishToMavenLocal) + (cd bindings/bdk-kotlin && ./gradlew :android:build) } OS=$(uname) From 152e2147e60dc9bc82fc2455dc0708b3b26b4d55 Mon Sep 17 00:00:00 2001 From: Sudarsan Balaji Date: Sat, 6 Nov 2021 00:42:32 +0530 Subject: [PATCH 6/8] Remove armv7 ABI target instead of i686 --- build.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/build.sh b/build.sh index 3ab3071..a2309a5 100755 --- a/build.sh +++ b/build.sh @@ -100,9 +100,9 @@ build_android() { export CFLAGS="-D__ANDROID_API__=21" # IMPORTANT: make sure every target is not a substring of a different one. We check for them with grep later on - BUILD_TARGETS="${BUILD_TARGETS:-aarch64,armv7,x86_64,i686}" + BUILD_TARGETS="${BUILD_TARGETS:-aarch64,x86_64,i686}" - mkdir -p bindings/bdk-kotlin/android/src/main/jniLibs/ bindings/bdk-kotlin/android/src/main/jniLibs/arm64-v8a bindings/bdk-kotlin/android/src/main/jniLibs/x86_64 bindings/bdk-kotlin/android/src/main/jniLibs/armeabi-v7a bindings/bdk-kotlin/android/src/main/jniLibs/x86 + mkdir -p bindings/bdk-kotlin/android/src/main/jniLibs/ bindings/bdk-kotlin/android/src/main/jniLibs/arm64-v8a bindings/bdk-kotlin/android/src/main/jniLibs/x86_64 bindings/bdk-kotlin/android/src/main/jniLibs/x86 if echo $BUILD_TARGETS | grep "aarch64"; then CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="aarch64-linux-android21-clang" CC="aarch64-linux-android21-clang" cargo build --target=aarch64-linux-android @@ -112,13 +112,9 @@ build_android() { CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER="x86_64-linux-android21-clang" CC="x86_64-linux-android21-clang" cargo build --target=x86_64-linux-android cp target/x86_64-linux-android/debug/libbdkffi.so bindings/bdk-kotlin/android/src/main/jniLibs/x86_64 fi - if echo $BUILD_TARGETS | grep "armv7"; then - CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER="armv7a-linux-androideabi21-clang" CC="armv7a-linux-androideabi21-clang" cargo build --target=armv7-linux-androideabi - cp target/armv7-linux-androideabi/debug/libbdkffi.so bindings/bdk-kotlin/android/src/main/jniLibs/armeabi-v7a - fi if echo $BUILD_TARGETS | grep "i686"; then CARGO_TARGET_I686_LINUX_ANDROID_LINKER="i686-linux-android21-clang" CC="i686-linux-android21-clang" cargo build --target=i686-linux-android - # cp target/i686-linux-android/debug/libbdkffi.so bindings/bdk-kotlin/android/src/main/jniLibs/x86 + cp target/i686-linux-android/debug/libbdkffi.so bindings/bdk-kotlin/android/src/main/jniLibs/x86 fi # copy sources From 39554e11be828211cdc164fa182f8b4ac1e2c27b Mon Sep 17 00:00:00 2001 From: Sudarsan Balaji Date: Sat, 6 Nov 2021 01:23:21 +0530 Subject: [PATCH 7/8] Update jvm package artifact id --- bindings/bdk-kotlin/jvm/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/bdk-kotlin/jvm/build.gradle b/bindings/bdk-kotlin/jvm/build.gradle index a0f754f..3f6b783 100644 --- a/bindings/bdk-kotlin/jvm/build.gradle +++ b/bindings/bdk-kotlin/jvm/build.gradle @@ -37,7 +37,7 @@ publishing { publications { maven(MavenPublication) { groupId = 'org.bitcoindevkit' - artifactId = 'bdk' + artifactId = 'bdk-jvm' version = '0.1.0' from components.java From 5ecfab3c0e8d6fc029eb80becaf89b4ab6d9cce4 Mon Sep 17 00:00:00 2001 From: Sudarsan Balaji Date: Sat, 6 Nov 2021 01:30:36 +0530 Subject: [PATCH 8/8] Add some notes on consuming published packages --- README.md | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 72efea4..365e1ac 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,42 @@ for the rust library bdk for the Bitcoin Dev Kit (BDK) project. | Kotlin | Android | WIP | | Swift | iOS | WIP | -## Getting Started + +## Getting Started (User) + +If you just want to consume the language bindings: + +### Kotlin (JVM) + +1. Add the following maven repository location to your build file: +``` +repositories { + maven { + url = uri("https://mymavenrepo.com/repo/hvZOau2SW1xzbycfC96m/") + } +} +``` +1. Add the dependency +``` +implementation("org.bitcoindevkit:bdk-jvm:0.1.0") +``` + +### Kotlin (Android) + +1. Add the following maven repository location to your build file: +``` +repositories { + maven { + url = uri("https://mymavenrepo.com/repo/hvZOau2SW1xzbycfC96m/") + } +} +``` +1. Add the dependency +``` +implementation("org.bitcoindevkit:bdk-android:0.1.0") +``` + +## Getting Started (Developer) This project uses rust. A basic knowledge of the rust ecosystem is helpful.