Skip to content

Commit

Permalink
Temp 16: Revert back to uniffi 0.23.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderbiscuit committed Oct 5, 2023
1 parent 413ec98 commit adc8f13
Show file tree
Hide file tree
Showing 20 changed files with 307 additions and 301 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/cont_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ on:

jobs:
build-test:
name: Build and test
name: "Build and test"
runs-on: ubuntu-20.04
defaults:
run:
working-directory: bdk-ffi
strategy:
matrix:
rust:
- version: 1.72.1 # STABLE
- version: 1.67.0
clippy: true
# TODO: Should we keep this? We'll need to pin dependencies
# - version: 1.61.0 # MSRV
Expand All @@ -34,26 +37,26 @@ jobs:
target
key: ${{ runner.os }}-cargo-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}

- name: Set default toolchain
- name: "Set default toolchain"
run: rustup default ${{ matrix.rust.version }}

- name: Set profile
- name: "Set profile"
run: rustup set profile minimal

- name: Add clippy
- name: "Add clippy"
if: ${{ matrix.rust.clippy }}
run: rustup component add clippy

- name: Update toolchain
- name: "Update toolchain"
run: rustup update

- name: Pin dependencies for MSRV
- name: "Pin dependencies for MSRV"
if: matrix.rust.version == '1.61.0'
run: |
cargo update -p hashlink --precise "0.8.1"
cargo update -p tokio --precise "1.29.1"
cargo update -p flate2 --precise "1.0.26"
- name: Build
- name: "Build"
run: cargo build

- name: Clippy
Expand All @@ -64,7 +67,7 @@ jobs:
run: CLASSPATH=./tests/jna/jna-5.8.0.jar cargo test --features uniffi/bindgen-tests

fmt:
name: Rust fmt
name: "Rust fmt"
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
distribution: temurin
java-version: 11

- name: "Set default Rust version to 1.72.1"
run: rustup default 1.72.1
- name: "Set default Rust version to 1.67.0"
run: rustup default 1.67.0

- name: "Install Rust Android targets"
run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/publish-jvm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
distribution: temurin
java-version: 11

- name: "Set default Rust version to 1.72.1"
run: rustup default 1.72.1
- name: "Set default Rust version to 1.67.0"
run: rustup default 1.67.0

- name: "Install aarch64 Rust target"
run: rustup target add aarch64-apple-darwin
Expand Down Expand Up @@ -54,8 +54,8 @@ jobs:
distribution: temurin
java-version: 11

- name: "Set default Rust version to 1.72.1"
run: rustup default 1.72.1
- name: "Set default Rust version to 1.67.0"
run: rustup default 1.67.0

- name: "Install x86_64-pc-windows-msvc Rust target"
run: rustup target add x86_64-pc-windows-msvc
Expand Down Expand Up @@ -94,8 +94,8 @@ jobs:
distribution: temurin
java-version: 11

- name: "Set default Rust version to 1.72.1"
run: rustup default 1.72.1
- name: "Set default Rust version to 1.67.0"
run: rustup default 1.67.0

- name: "Build bdk-jvm library"
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-android.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
distribution: temurin
java-version: 11

- name: "Set default Rust version to 1.72.1"
run: rustup default 1.72.1
- name: "Set default Rust version to 1.67.0"
run: rustup default 1.67.0

- name: "Install Rust Android targets"
run: rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/test-jvm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,10 @@ jobs:
distribution: temurin
java-version: 11

- name: "Set default Rust version to 1.72.1"
run: rustup default 1.72.1
- name: "Set default Rust version to 1.67.0"
run: rustup default 1.67.0

- name: "Run JVM tests"
run: |
cd bdk-jvm
./gradlew buildJvmLib
./gradlew test
- name: "Print directory structure"
run: |
pwd
ls -R
20 changes: 10 additions & 10 deletions .github/workflows/test-swift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,34 @@ jobs:
build:
runs-on: macos-12
steps:
- name: Checkout
- name: "Checkout"
uses: actions/checkout@v3

- name: "Set default Rust version to 1.72.1"
run: rustup default 1.72.1
- name: "Set default Rust version to 1.67.0"
run: rustup default 1.67.0

- name: Install Rust targets
- name: "Install Rust targets"
run: |
rustup install nightly-x86_64-apple-darwin
rustup component add rust-src --toolchain nightly-x86_64-apple-darwin
rustup target add aarch64-apple-darwin x86_64-apple-darwin
- name: Run bdk-ffi-bindgen
- name: "Run bdk-ffi-bindgen"
working-directory: bdk-ffi
run: cargo run --bin uniffi-bindgen generate src/bdk.udl --language swift --out-dir ../bdk-swift/Sources/BitcoinDevKit --no-format

- name: Build bdk-ffi for x86_64-apple-darwin
- name: "Build bdk-ffi for x86_64-apple-darwin"
run: cargo build --package bdk-ffi --profile release-smaller --target x86_64-apple-darwin

- name: Build bdk-ffi for aarch64-apple-darwin
- name: "Build bdk-ffi for aarch64-apple-darwin"
run: cargo build --package bdk-ffi --profile release-smaller --target aarch64-apple-darwin

- name: Create lipo-macos
- name: "Create lipo-macos"
run: |
mkdir -p target/lipo-macos/release-smaller
lipo target/aarch64-apple-darwin/release-smaller/libbdkffi.a target/x86_64-apple-darwin/release-smaller/libbdkffi.a -create -output target/lipo-macos/release-smaller/libbdkffi.a
- name: Create bdkFFI.xcframework
- name: "Create bdkFFI.xcframework"
working-directory: bdk-swift
run: |
mv Sources/BitcoinDevKit/bdk.swift Sources/BitcoinDevKit/BitcoinDevKit.swift
Expand All @@ -50,6 +50,6 @@ jobs:
rm Sources/BitcoinDevKit/bdkFFI.h
rm Sources/BitcoinDevkit/bdkFFI.modulemap
- name: Run Swift tests
- name: "Run Swift tests"
working-directory: bdk-swift
run: swift test
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,14 @@ internal class UniFfiAndroidPlugin : Plugin<Project> {
val generateAndroidBindings by tasks.register<Exec>("generateAndroidBindings") {
dependsOn(moveNativeAndroidLibs)

val libraryPath = "${project.projectDir}/../../bdk-ffi/target/aarch64-linux-android/release-smaller/libbdkffi.so"
workingDir("${project.projectDir}/../../bdk-ffi")
// val libraryPath = "${project.projectDir}/../../bdk-ffi/target/aarch64-linux-android/release-smaller/libbdkffi.so"
// workingDir("${project.projectDir}/../../bdk-ffi")
// val cargoArgs: List<String> = listOf("run", "--bin", "uniffi-bindgen", "generate", "--library", libraryPath, "--language", "kotlin", "--out-dir", "../bdk-android/lib/src/main/kotlin", "--no-format")

val cargoArgs: List<String> = listOf("run", "--bin", "uniffi-bindgen", "generate", "--library", libraryPath, "--language", "kotlin", "--out-dir", "../bdk-android/lib/src/main/kotlin", "--no-format")
// The code above worked for uniffi 0.24.3 using the --library flag
// The code below works for uniffi 0.23.0
workingDir("${project.projectDir}/../../bdk-ffi")
val cargoArgs: List<String> = listOf("run", "--bin", "uniffi-bindgen", "generate", "src/bdk.udl", "--language", "kotlin", "--out-dir", "../bdk-android/lib/src/main/kotlin", "--no-format")

executable("cargo")
args(cargoArgs)
Expand Down
Loading

0 comments on commit adc8f13

Please sign in to comment.