diff --git a/.github/workflows/publish-android.yaml b/.github/workflows/publish-android.yaml index a7a22e76..3df8fc07 100644 --- a/.github/workflows/publish-android.yaml +++ b/.github/workflows/publish-android.yaml @@ -2,23 +2,13 @@ name: Publish bdk-android to Maven Central on: [workflow_dispatch] # The default Android NDK on the ubuntu-22.04 image is 25.2.9519653 -# We replace the default environment variable ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/25.2.9519653 -# with an older version of the NDK (21.4.7075529) using the fix proposed here: https://github.com/actions/runner-images/issues/5930 -# For information on why this is needed at the moment see issues #242 and #243, and PR #282 env: - ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/21.4.7075529 + ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/25.2.9519653 jobs: build: runs-on: ubuntu-20.04 steps: - - name: "Install Android NDK 21.4.7075529" - run: | - ANDROID_ROOT=/usr/local/lib/android - ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk - SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager - echo "y" | $SDKMANAGER "ndk;21.4.7075529" - - name: "Check out PR branch" uses: actions/checkout@v3 diff --git a/.github/workflows/test-android.yaml b/.github/workflows/test-android.yaml index d15ff9db..a5438911 100644 --- a/.github/workflows/test-android.yaml +++ b/.github/workflows/test-android.yaml @@ -11,23 +11,13 @@ on: - "bdk-android/**" # The default Android NDK on the ubuntu-22.04 image is 25.2.9519653 -# We replace the default environment variable ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/25.2.9519653 -# with an older version of the NDK (21.4.7075529) using the fix proposed here: https://github.com/actions/runner-images/issues/5930 -# For information on why this is needed at the moment see issues #242 and #243, and PR #282 env: - ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/21.4.7075529 + ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/25.2.9519653 jobs: build: runs-on: ubuntu-20.04 steps: - - name: "Install Android NDK 21.4.7075529" - run: | - ANDROID_ROOT=/usr/local/lib/android - ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk - SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager - echo "y" | $SDKMANAGER "ndk;21.4.7075529" - - name: "Check out PR branch" uses: actions/checkout@v3 diff --git a/bdk-android/README.md b/bdk-android/README.md index d8c304a9..8cdfc452 100644 --- a/bdk-android/README.md +++ b/bdk-android/README.md @@ -48,17 +48,17 @@ dependencies { * [Padawan Wallet](https://github.com/thunderbiscuit/padawan-wallet) ### How to build -_Note that Kotlin version `1.6.10` or later is required to build the library._ +_Note that Kotlin version `1.9.23` or later is required to build the library._ 1. Clone this repository. ```shell git clone https://github.com/bitcoindevkit/bdk-ffi ``` 2. Follow the "General" bdk-ffi ["Getting Started (Developer)"] instructions. -3. Install Rust (note that we are currently building using Rust 1.67.0): +3. Install Rust (note that we are currently building using Rust stable): ```shell curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -rustup default 1.67.0 +rustup default stable ``` 4. Install required targets ```sh @@ -66,10 +66,10 @@ rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-android ``` 5. Install Android SDK and Build-Tools for API level 30+ 6. Setup `$ANDROID_SDK_ROOT` and `$ANDROID_NDK_ROOT` path variables (which are required by the - build tool), for example (note that currently, NDK version 21.4.7075529 is required): + build tool), for example (note that currently, NDK version 25.2.9519653 is required): ```shell export ANDROID_SDK_ROOT=~/Android/Sdk -export ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/21.4.7075529 +export ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/25.2.9519653 ``` 7. Build kotlin bindings ```sh diff --git a/bdk-android/lib/build.gradle.kts b/bdk-android/lib/build.gradle.kts index 534930be..f194df7e 100644 --- a/bdk-android/lib/build.gradle.kts +++ b/bdk-android/lib/build.gradle.kts @@ -5,7 +5,7 @@ val libraryVersion: String by project plugins { id("com.android.library") - id("org.jetbrains.kotlin.android") version "1.6.10" + id("org.jetbrains.kotlin.android") version "1.9.23" id("maven-publish") id("signing") diff --git a/bdk-android/plugins/src/main/kotlin/org/bitcoindevkit/plugins/UniFfiAndroidPlugin.kt b/bdk-android/plugins/src/main/kotlin/org/bitcoindevkit/plugins/UniFfiAndroidPlugin.kt index 20200864..ea0e6911 100644 --- a/bdk-android/plugins/src/main/kotlin/org/bitcoindevkit/plugins/UniFfiAndroidPlugin.kt +++ b/bdk-android/plugins/src/main/kotlin/org/bitcoindevkit/plugins/UniFfiAndroidPlugin.kt @@ -36,10 +36,10 @@ internal class UniFfiAndroidPlugin : Plugin { environment( // add build toolchain to PATH Pair("PATH", "${System.getenv("PATH")}:${System.getenv("ANDROID_NDK_ROOT")}/toolchains/llvm/prebuilt/$llvmArchPath/bin"), - Pair("CFLAGS", "-D__ANDROID_MIN_SDK_VERSION__=21"), + Pair("CFLAGS", "-D__ANDROID_MIN_SDK_VERSION__=24"), Pair("AR", "llvm-ar"), - Pair("CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER", "aarch64-linux-android21-clang"), - Pair("CC", "aarch64-linux-android21-clang") + Pair("CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER", "aarch64-linux-android24-clang"), + Pair("CC", "aarch64-linux-android24-clang") ) doLast { @@ -66,10 +66,10 @@ internal class UniFfiAndroidPlugin : Plugin { environment( // add build toolchain to PATH Pair("PATH", "${System.getenv("PATH")}:${System.getenv("ANDROID_NDK_ROOT")}/toolchains/llvm/prebuilt/$llvmArchPath/bin"), - Pair("CFLAGS", "-D__ANDROID_MIN_SDK_VERSION__=21"), + Pair("CFLAGS", "-D__ANDROID_MIN_SDK_VERSION__=24"), Pair("AR", "llvm-ar"), - Pair("CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER", "x86_64-linux-android21-clang"), - Pair("CC", "x86_64-linux-android21-clang") + Pair("CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER", "x86_64-linux-android24-clang"), + Pair("CC", "x86_64-linux-android24-clang") ) doLast { diff --git a/bdk-jvm/README.md b/bdk-jvm/README.md index 8a282475..8d2720d2 100644 --- a/bdk-jvm/README.md +++ b/bdk-jvm/README.md @@ -47,17 +47,17 @@ dependencies { * [Tatooine Faucet](https://github.com/thunderbiscuit/tatooine) ## How to build -_Note that Kotlin version `1.6.10` or later is required to build the library._ +_Note that Kotlin version `1.9.23` or later is required to build the library._ 1. Install JDK 11. It must be version 11 (not 17), otherwise it won't build. For example, with SDKMAN!: ```shell curl -s "https://get.sdkman.io" | bash source "$HOME/.sdkman/bin/sdkman-init.sh" sdk install java 11.0.19-tem ``` -2. Install Rust (note that we are currently building using Rust 1.67.0): +2. Install Rust (note that we are currently building using Rust stable): ```shell curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -rustup default 1.67.0 +rustup default stable ``` 3. Clone this repository. ```shell diff --git a/bdk-jvm/lib/build.gradle.kts b/bdk-jvm/lib/build.gradle.kts index 31534ab6..9feaf365 100644 --- a/bdk-jvm/lib/build.gradle.kts +++ b/bdk-jvm/lib/build.gradle.kts @@ -6,7 +6,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile val libraryVersion: String by project plugins { - id("org.jetbrains.kotlin.jvm") version "1.6.10" + id("org.jetbrains.kotlin.jvm") version "1.9.23" id("java-library") id("maven-publish") id("signing") diff --git a/bdk-python/scripts/generate-linux.sh b/bdk-python/scripts/generate-linux.sh index 1e4eebe6..96318995 100644 --- a/bdk-python/scripts/generate-linux.sh +++ b/bdk-python/scripts/generate-linux.sh @@ -9,7 +9,7 @@ cd ../bdk-ffi/ cargo run --bin uniffi-bindgen generate src/bdk.udl --language python --out-dir ../bdk-python/src/bdkpython/ --no-format echo "Generating native binaries..." -rustup default 1.67.0 +rustup default stable cargo build --profile release-smaller echo "Copying linux libbdkffi.so..." diff --git a/bdk-python/scripts/generate-macos-arm64.sh b/bdk-python/scripts/generate-macos-arm64.sh index 87a8c356..af783af6 100644 --- a/bdk-python/scripts/generate-macos-arm64.sh +++ b/bdk-python/scripts/generate-macos-arm64.sh @@ -9,7 +9,7 @@ cd ../bdk-ffi/ cargo run --bin uniffi-bindgen generate src/bdk.udl --language python --out-dir ../bdk-python/src/bdkpython/ --no-format echo "Generating native binaries..." -rustup default 1.67.0 +rustup default stable rustup target add aarch64-apple-darwin cargo build --profile release-smaller --target aarch64-apple-darwin diff --git a/bdk-python/scripts/generate-windows.sh b/bdk-python/scripts/generate-windows.sh index 16ec0aba..a705a8b8 100644 --- a/bdk-python/scripts/generate-windows.sh +++ b/bdk-python/scripts/generate-windows.sh @@ -9,7 +9,7 @@ cd ../bdk-ffi/ cargo run --bin uniffi-bindgen generate src/bdk.udl --language python --out-dir ../bdk-python/src/bdkpython/ --no-format echo "Generating native binaries..." -rustup default 1.67.0 +rustup default stable rustup target add x86_64-pc-windows-msvc cargo build --profile release-smaller --target x86_64-pc-windows-msvc diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 00000000..7369b4e4 --- /dev/null +++ b/clippy.toml @@ -0,0 +1 @@ +msrv="1.77.1"