diff --git a/README.md b/README.md index c0e4388..a4bf1d9 100644 --- a/README.md +++ b/README.md @@ -44,16 +44,22 @@ val newAddress = wallet.getNewAddress() ### How to build +1. Clone this repository and init and update it's [`bdk-ffi`] submodule. + ```shell + git clone https://github.com/bitcoindevkit/bdk-kotlin + git submodule update --init + ``` +1. Follow the "General" bdk-ffi ["Getting Started (Developer)"] instructions. 1. Install required targets ```sh rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi i686-linux-android ``` 1. Install Android SDK and Build-Tools for API level 30+ 1. Setup `$ANDROID_SDK_ROOT` and `$ANDROID_NDK_HOME` path variables (which are required by the - build scripts), for example: + build scripts), for example (NDK major version 21 is required): ```shell export ANDROID_SDK_ROOT=~/Android/Sdk - export ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/21.3.6528147 + export ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/21. ``` 1. Build kotlin bindings ```sh @@ -69,11 +75,11 @@ val newAddress = wallet.getNewAddress() ``` 1. Publish ```shell - ./gradlew :jvm:publishReleasePublicationToMavenLocal - ./gradlew :android:publishReleasePublicationToMavenLocal + ./gradlew :jvm:publishToMavenLocal + ./gradlew :android:publishToMavenLocal ``` -### How to publish to maven central (project maintainers only) +### How to publish to maven central with [Gradle Nexus Publish Plugin] (project maintainers only) 1. Set your `~/.gradle/gradle.properties` signing key values and SONATYPE login ```properties @@ -96,3 +102,4 @@ val newAddress = wallet.getNewAddress() [`bdk`]: https://github.com/bitcoindevkit/bdk [`bdk-ffi`]: https://github.com/bitcoindevkit/bdk-ffi ["Getting Started (Developer)"]: https://github.com/bitcoindevkit/bdk-ffi#getting-started-developer +[Gradle Nexus Publish Plugin]: https://github.com/gradle-nexus/publish-plugin diff --git a/android/build.gradle b/android/build.gradle index 3d68c8d..eddc329 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -4,11 +4,11 @@ apply plugin: 'maven-publish' apply plugin: 'signing' android { - compileSdkVersion 30 + compileSdkVersion 31 defaultConfig { minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 31 versionCode 1 versionName "1.0" @@ -27,13 +27,13 @@ android { dependencies { implementation 'net.java.dev.jna:jna:5.8.0@aar' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'androidx.appcompat:appcompat:1.3.0' - implementation 'androidx.core:core-ktx:1.5.0' + implementation 'androidx.appcompat:appcompat:1.4.0' + implementation 'androidx.core:core-ktx:1.7.0' api "org.slf4j:slf4j-api:1.7.30" androidTestImplementation 'com.github.tony19:logback-android:2.0.0' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' androidTestImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1' } @@ -43,14 +43,13 @@ afterEvaluate { 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-android' - version = '0.2.0' - - // Applies the component for the release build variant. - from components.release + version = '0.2.2' pom { name = 'bdk-android' diff --git a/build.gradle b/build.gradle index 5946db4..00e81bf 100644 --- a/build.gradle +++ b/build.gradle @@ -1,30 +1,21 @@ buildscript { - ext.kotlin_version = '1.5.10' + ext.kotlin_version = '1.6.10' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.2.1' + classpath 'com.android.tools.build:gradle:7.0.4' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } plugins { - id "java-library" id "signing" id "maven-publish" id "io.github.gradle-nexus.publish-plugin" version "1.1.0" } -publishing { - publications { - mavenJava(MavenPublication) { - from(components.java) - } - } -} - signing { def signingKey = findProperty("signingKey") def signingPassword = findProperty("signingPassword") @@ -53,7 +44,7 @@ allprojects { tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { kotlinOptions { freeCompilerArgs += [ - "-Xuse-experimental=kotlin.ExperimentalUnsignedTypes", + "-Xopt-in=kotlin.ExperimentalUnsignedTypes", ] } } diff --git a/demo/gradle/wrapper/gradle-wrapper.jar b/demo/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 7454180..0000000 Binary files a/demo/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/demo/gradle/wrapper/gradle-wrapper.properties b/demo/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 69a9715..0000000 --- a/demo/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a2..d2880ba 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/jvm/build.gradle b/jvm/build.gradle index 9354102..c0a8c15 100644 --- a/jvm/build.gradle +++ b/jvm/build.gradle @@ -34,11 +34,11 @@ afterEvaluate { publications { release(MavenPublication) { + from components.java + groupId = 'org.bitcoindevkit' artifactId = 'bdk-jvm' - version = '0.2.0' - - from components.java + version = '0.2.2' pom { name = 'bdk-jvm'