Merge pull request #73 from bitcoindevkit/publish-a-package
Publish android and kotlin packages
This commit is contained in:
commit
3e0ae31890
2
.gitignore
vendored
2
.gitignore
vendored
@ -15,3 +15,5 @@ local.properties
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
testdb
|
testdb
|
||||||
xcuserdata
|
xcuserdata
|
||||||
|
.lsp
|
||||||
|
.clj-kondo
|
||||||
|
37
README.md
37
README.md
@ -11,7 +11,42 @@ for the rust library bdk for the Bitcoin Dev Kit (BDK) project.
|
|||||||
| Kotlin | Android | WIP |
|
| Kotlin | Android | WIP |
|
||||||
| Swift | iOS | 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.
|
This project uses rust. A basic knowledge of the rust ecosystem is helpful.
|
||||||
|
|
||||||
|
10
build.sh
10
build.sh
@ -100,9 +100,9 @@ build_android() {
|
|||||||
export CFLAGS="-D__ANDROID_API__=21"
|
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
|
# 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
|
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
|
CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="aarch64-linux-android21-clang" CC="aarch64-linux-android21-clang" cargo build --target=aarch64-linux-android
|
||||||
@ -112,10 +112,6 @@ 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
|
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
|
cp target/x86_64-linux-android/debug/libbdkffi.so bindings/bdk-kotlin/android/src/main/jniLibs/x86_64
|
||||||
fi
|
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
|
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
|
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
|
||||||
@ -125,7 +121,7 @@ build_android() {
|
|||||||
cp -R bindings/bdk-kotlin/jvm/src/main/kotlin bindings/bdk-kotlin/android/src/main
|
cp -R bindings/bdk-kotlin/jvm/src/main/kotlin bindings/bdk-kotlin/android/src/main
|
||||||
|
|
||||||
# bdk-kotlin aar
|
# bdk-kotlin aar
|
||||||
(cd bindings/bdk-kotlin && ./gradlew :android:build && ./gradlew :android:publishToMavenLocal)
|
(cd bindings/bdk-kotlin && ./gradlew :android:build)
|
||||||
}
|
}
|
||||||
|
|
||||||
OS=$(uname)
|
OS=$(uname)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user