mirror of
https://github.com/aljazceru/breez-sdk-liquid.git
synced 2025-12-18 06:24:21 +01:00
Update selected built packages to Uniffi 0.28 (#766)
This commit is contained in:
71
.github/workflows/build-bindings-android.yml
vendored
71
.github/workflows/build-bindings-android.yml
vendored
@@ -21,14 +21,35 @@ on:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
uniffi-25:
|
||||
description: 'If true, builds additional bindings for Uniffi 0.25'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
name: Setup
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: set-matrix
|
||||
run: |
|
||||
if [ ${{ inputs.uniffi-25 }} == true ]; then
|
||||
echo "::set-output name=matrix::['', '-uniffi-25']"
|
||||
else
|
||||
echo "::set-output name=matrix::['']"
|
||||
fi
|
||||
outputs:
|
||||
uniffi-matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
|
||||
build:
|
||||
if: ${{ !inputs.use-dummy-binaries }}
|
||||
runs-on: ubuntu-latest
|
||||
name: build ${{ matrix.target }}
|
||||
name: build ${{ matrix.target }}${{ matrix.uniffi }}
|
||||
needs: setup
|
||||
strategy:
|
||||
matrix:
|
||||
uniffi: ${{ fromJson(needs.setup.outputs.uniffi-matrix) }}
|
||||
target: [
|
||||
aarch64-linux-android,
|
||||
x86_64-linux-android,
|
||||
@@ -55,12 +76,18 @@ jobs:
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: ${{ matrix.uniffi }}
|
||||
workspaces: lib
|
||||
|
||||
- name: Build bindings
|
||||
if: matrix.uniffi != '-uniffi-25'
|
||||
working-directory: lib/bindings
|
||||
run: |
|
||||
cargo ndk -t ${{ matrix.target }} build --release
|
||||
run: cargo ndk -t ${{ matrix.target }} build --release
|
||||
|
||||
- name: Build bindings Uniffi 0.25
|
||||
if: matrix.uniffi == '-uniffi-25'
|
||||
working-directory: lib/bindings
|
||||
run: cargo ndk -t ${{ matrix.target }} build --no-default-features --features=uniffi-25 --release
|
||||
|
||||
- name: Copy build output
|
||||
run: |
|
||||
@@ -73,36 +100,43 @@ jobs:
|
||||
- name: Archive release
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-${{ matrix.target }}
|
||||
name: bindings-${{ matrix.target }}${{ matrix.uniffi }}
|
||||
path: dist/*
|
||||
|
||||
jnilibs:
|
||||
needs: build
|
||||
needs:
|
||||
- setup
|
||||
- build
|
||||
runs-on: ubuntu-latest
|
||||
name: build jniLibs
|
||||
name: build jniLibs${{ matrix.uniffi }}
|
||||
strategy:
|
||||
matrix:
|
||||
uniffi: ${{ fromJson(needs.setup.outputs.uniffi-matrix) }}
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-aarch64-linux-android
|
||||
name: bindings-aarch64-linux-android${{ matrix.uniffi }}
|
||||
path: arm64-v8a
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-x86_64-linux-android
|
||||
name: bindings-x86_64-linux-android${{ matrix.uniffi }}
|
||||
path: x86_64
|
||||
|
||||
- name: Archive jniLibs
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-android-jniLibs
|
||||
name: bindings-android-jniLibs${{ matrix.uniffi }}
|
||||
path: ./*
|
||||
|
||||
build-dummies:
|
||||
if: ${{ inputs.use-dummy-binaries }}
|
||||
runs-on: ubuntu-latest
|
||||
name: build android dummies
|
||||
name: build dummies ${{ matrix.target }}${{ matrix.uniffi }}
|
||||
needs: setup
|
||||
strategy:
|
||||
matrix:
|
||||
uniffi: ${{ fromJson(needs.setup.outputs.uniffi-matrix) }}
|
||||
target: [
|
||||
aarch64-linux-android,
|
||||
x86_64-linux-android,
|
||||
@@ -116,26 +150,31 @@ jobs:
|
||||
- name: Upload dummy Android ${{ matrix.target }} artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-${{ matrix.target }}
|
||||
name: bindings-${{ matrix.target }}${{ matrix.uniffi }}
|
||||
path: ./*
|
||||
|
||||
jnilibs-dummy:
|
||||
needs: build-dummies
|
||||
needs:
|
||||
- setup
|
||||
- build-dummies
|
||||
runs-on: ubuntu-latest
|
||||
name: build jniLibs dummy
|
||||
name: build jniLibs dummy ${{ matrix.target }}${{ matrix.uniffi }}
|
||||
strategy:
|
||||
matrix:
|
||||
uniffi: ${{ fromJson(needs.setup.outputs.uniffi-matrix) }}
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-aarch64-linux-android
|
||||
name: bindings-aarch64-linux-android${{ matrix.uniffi }}
|
||||
path: arm64-v8a
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-x86_64-linux-android
|
||||
name: bindings-x86_64-linux-android${{ matrix.uniffi }}
|
||||
path: x86_64
|
||||
|
||||
- name: Archive jniLibs
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-android-jniLibs
|
||||
name: bindings-android-jniLibs${{ matrix.uniffi }}
|
||||
path: ./*
|
||||
54
.github/workflows/build-bindings-darwin.yml
vendored
54
.github/workflows/build-bindings-darwin.yml
vendored
@@ -21,14 +21,35 @@ on:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
uniffi-25:
|
||||
description: 'If true, builds additional bindings for Uniffi 0.25'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
name: Setup
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: set-matrix
|
||||
run: |
|
||||
if [ ${{ inputs.uniffi-25 }} == true ]; then
|
||||
echo "::set-output name=matrix::['', '-uniffi-25']"
|
||||
else
|
||||
echo "::set-output name=matrix::['']"
|
||||
fi
|
||||
outputs:
|
||||
uniffi-matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
|
||||
build:
|
||||
if: ${{ !inputs.use-dummy-binaries }}
|
||||
runs-on: macOS-latest
|
||||
name: build ${{ matrix.target }}
|
||||
name: build ${{ matrix.target }}${{ matrix.uniffi }}
|
||||
needs: setup
|
||||
strategy:
|
||||
matrix:
|
||||
uniffi: ${{ fromJson(needs.setup.outputs.uniffi-matrix) }}
|
||||
target: [
|
||||
aarch64-apple-darwin,
|
||||
x86_64-apple-darwin,
|
||||
@@ -55,33 +76,45 @@ jobs:
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: ${{ matrix.uniffi }}
|
||||
workspaces: lib
|
||||
|
||||
- name: Build bindings
|
||||
if: matrix.uniffi != '-uniffi-25'
|
||||
working-directory: lib/bindings
|
||||
run: cargo lipo --release --targets ${{ matrix.target }}
|
||||
|
||||
- name: Build bindings Uniffi 0.25
|
||||
if: matrix.uniffi == '-uniffi-25'
|
||||
working-directory: lib/bindings
|
||||
run: cargo lipo --no-default-features --features=uniffi-25 --release --targets ${{ matrix.target }}
|
||||
|
||||
- name: Archive release
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-${{ matrix.target }}
|
||||
name: bindings-${{ matrix.target }}${{ matrix.uniffi }}
|
||||
path: |
|
||||
lib/target/${{ matrix.target }}/release/libbreez_sdk_liquid_bindings.dylib
|
||||
lib/target/${{ matrix.target }}/release/libbreez_sdk_liquid_bindings.a
|
||||
|
||||
merge:
|
||||
runs-on: macOS-latest
|
||||
needs: build
|
||||
name: build darwin-universal
|
||||
needs:
|
||||
- setup
|
||||
- build
|
||||
name: build darwin-universal${{ matrix.uniffi }}
|
||||
strategy:
|
||||
matrix:
|
||||
uniffi: ${{ fromJson(needs.setup.outputs.uniffi-matrix) }}
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-aarch64-apple-darwin
|
||||
name: bindings-aarch64-apple-darwin${{ matrix.uniffi }}
|
||||
path: aarch64-apple-darwin
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-x86_64-apple-darwin
|
||||
name: bindings-x86_64-apple-darwin${{ matrix.uniffi }}
|
||||
path: x86_64-apple-darwin
|
||||
|
||||
- name: Build Darwin universal
|
||||
@@ -93,7 +126,7 @@ jobs:
|
||||
- name: Archive release
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-darwin-universal
|
||||
name: bindings-darwin-universal${{ matrix.uniffi }}
|
||||
path: |
|
||||
darwin-universal/libbreez_sdk_liquid_bindings.dylib
|
||||
darwin-universal/libbreez_sdk_liquid_bindings.a
|
||||
@@ -101,9 +134,12 @@ jobs:
|
||||
build-dummies:
|
||||
if: ${{ inputs.use-dummy-binaries }}
|
||||
runs-on: ubuntu-latest
|
||||
name: build darwin dummies
|
||||
name: build dummies ${{ matrix.target }}${{ matrix.uniffi }}
|
||||
needs:
|
||||
- setup
|
||||
strategy:
|
||||
matrix:
|
||||
uniffi: ${{ fromJson(needs.setup.outputs.uniffi-matrix) }}
|
||||
target: [
|
||||
aarch64-apple-darwin,
|
||||
x86_64-apple-darwin,
|
||||
@@ -118,5 +154,5 @@ jobs:
|
||||
- name: Upload dummy darwin ${{ matrix.target }} artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-${{ matrix.target }}
|
||||
name: bindings-${{ matrix.target }}${{ matrix.uniffi }}
|
||||
path: ./*
|
||||
57
.github/workflows/build-bindings-ios.yml
vendored
57
.github/workflows/build-bindings-ios.yml
vendored
@@ -21,14 +21,35 @@ on:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
uniffi-25:
|
||||
description: 'If true, builds additional bindings for Uniffi 0.25'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
name: Setup
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: set-matrix
|
||||
run: |
|
||||
if [ ${{ inputs.uniffi-25 }} == true ]; then
|
||||
echo "::set-output name=matrix::['', '-uniffi-25']"
|
||||
else
|
||||
echo "::set-output name=matrix::['']"
|
||||
fi
|
||||
outputs:
|
||||
uniffi-matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
|
||||
build:
|
||||
if: ${{ !inputs.use-dummy-binaries }}
|
||||
runs-on: macOS-latest
|
||||
name: build ${{ matrix.target }}
|
||||
name: build ${{ matrix.target }}${{ matrix.uniffi }}
|
||||
needs: setup
|
||||
strategy:
|
||||
matrix:
|
||||
uniffi: ${{ fromJson(needs.setup.outputs.uniffi-matrix) }}
|
||||
target: [
|
||||
aarch64-apple-ios,
|
||||
x86_64-apple-ios,
|
||||
@@ -58,6 +79,7 @@ jobs:
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: ${{ matrix.uniffi }}
|
||||
workspaces: lib
|
||||
|
||||
- name: Install xcode
|
||||
@@ -66,33 +88,44 @@ jobs:
|
||||
xcode-version: latest-stable
|
||||
|
||||
- name: Build bindings
|
||||
if: matrix.uniffi != '-uniffi-25'
|
||||
working-directory: lib/bindings
|
||||
run: cargo build --release --target ${{ matrix.target }}
|
||||
|
||||
- name: Build bindings Uniffi 0.25
|
||||
if: matrix.uniffi == '-uniffi-25'
|
||||
working-directory: lib/bindings
|
||||
run: cargo build --no-default-features --features=uniffi-25 --release --target ${{ matrix.target }}
|
||||
|
||||
- name: Archive release
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-${{ matrix.target }}
|
||||
name: bindings-${{ matrix.target }}${{ matrix.uniffi }}
|
||||
path: lib/target/${{ matrix.target }}/release/libbreez_sdk_liquid_bindings.a
|
||||
|
||||
merge:
|
||||
runs-on: macOS-latest
|
||||
needs: build
|
||||
name: build ios-universal
|
||||
needs:
|
||||
- setup
|
||||
- build
|
||||
name: build ios-universal${{ matrix.uniffi }}
|
||||
strategy:
|
||||
matrix:
|
||||
uniffi: ${{ fromJson(needs.setup.outputs.uniffi-matrix) }}
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-aarch64-apple-ios
|
||||
name: bindings-aarch64-apple-ios${{ matrix.uniffi }}
|
||||
path: aarch64-apple-ios
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-x86_64-apple-ios
|
||||
name: bindings-x86_64-apple-ios${{ matrix.uniffi }}
|
||||
path: x86_64-apple-ios
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-aarch64-apple-ios-sim
|
||||
name: bindings-aarch64-apple-ios-sim${{ matrix.uniffi }}
|
||||
path: aarch64-apple-ios-sim
|
||||
|
||||
- name: Build ios-universal
|
||||
@@ -108,21 +141,23 @@ jobs:
|
||||
- name: Archive ios-universal
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-ios-universal
|
||||
name: bindings-ios-universal${{ matrix.uniffi }}
|
||||
path: ios-universal/libbreez_sdk_liquid_bindings.a
|
||||
|
||||
- name: Archive ios-universal-sim
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-ios-universal-sim
|
||||
name: bindings-ios-universal-sim${{ matrix.uniffi }}
|
||||
path: ios-universal-sim/libbreez_sdk_liquid_bindings.a
|
||||
|
||||
build-dummies:
|
||||
if: ${{ inputs.use-dummy-binaries }}
|
||||
runs-on: ubuntu-latest
|
||||
name: build ios dummies
|
||||
name: build dummies ${{ matrix.target }}${{ matrix.uniffi }}
|
||||
needs: setup
|
||||
strategy:
|
||||
matrix:
|
||||
uniffi: ${{ fromJson(needs.setup.outputs.uniffi-matrix) }}
|
||||
target: [
|
||||
aarch64-apple-ios,
|
||||
x86_64-apple-ios,
|
||||
@@ -138,5 +173,5 @@ jobs:
|
||||
- name: Upload dummy ios ${{ matrix.target }} artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-${{ matrix.target }}
|
||||
name: bindings-${{ matrix.target }}{{ matrix.uniffi }}
|
||||
path: ./*
|
||||
|
||||
41
.github/workflows/build-bindings-linux.yml
vendored
41
.github/workflows/build-bindings-linux.yml
vendored
@@ -21,14 +21,35 @@ on:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
uniffi-25:
|
||||
description: 'If true, builds additional bindings for Uniffi 0.25'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
name: Setup
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: set-matrix
|
||||
run: |
|
||||
if [ ${{ inputs.uniffi-25 }} == true ]; then
|
||||
echo "::set-output name=matrix::['', '-uniffi-25']"
|
||||
else
|
||||
echo "::set-output name=matrix::['']"
|
||||
fi
|
||||
outputs:
|
||||
uniffi-matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
|
||||
build:
|
||||
if: ${{ !inputs.use-dummy-binaries }}
|
||||
runs-on: ubuntu-20.04
|
||||
name: build ${{ matrix.target }}
|
||||
name: build ${{ matrix.target }}${{ matrix.uniffi }}
|
||||
needs: setup
|
||||
strategy:
|
||||
matrix:
|
||||
uniffi: ${{ fromJson(needs.setup.outputs.uniffi-matrix) }}
|
||||
target: [
|
||||
aarch64-unknown-linux-gnu,
|
||||
x86_64-unknown-linux-gnu,
|
||||
@@ -66,27 +87,39 @@ jobs:
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: ${{ matrix.uniffi }}
|
||||
workspaces: lib
|
||||
|
||||
- name: Build bindings
|
||||
if: matrix.uniffi != '-uniffi-25'
|
||||
working-directory: lib/bindings
|
||||
env:
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/aarch64-linux-gnu-gcc
|
||||
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/x86_64-linux-gnu-gcc
|
||||
run: cargo build --release --target ${{ matrix.target }}
|
||||
|
||||
- name: Build bindings Uniffi 0.25
|
||||
if: matrix.uniffi == '-uniffi-25'
|
||||
working-directory: lib/bindings
|
||||
env:
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/aarch64-linux-gnu-gcc
|
||||
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: /usr/bin/x86_64-linux-gnu-gcc
|
||||
run: cargo build --no-default-features --features=uniffi-25 --release --target ${{ matrix.target }}
|
||||
|
||||
- name: Archive release
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-${{ matrix.target }}
|
||||
name: bindings-${{ matrix.target }}${{ matrix.uniffi }}
|
||||
path: lib/target/${{ matrix.target }}/release/libbreez_sdk_liquid_bindings.so
|
||||
|
||||
build-dummies:
|
||||
if: ${{ inputs.use-dummy-binaries }}
|
||||
runs-on: ubuntu-latest
|
||||
name: build linux dummies
|
||||
name: build dummies ${{ matrix.target }}${{ matrix.uniffi }}
|
||||
needs: setup
|
||||
strategy:
|
||||
matrix:
|
||||
uniffi: ${{ fromJson(needs.setup.outputs.uniffi-matrix) }}
|
||||
target: [
|
||||
aarch64-unknown-linux-gnu,
|
||||
x86_64-unknown-linux-gnu,
|
||||
@@ -99,5 +132,5 @@ jobs:
|
||||
- name: Upload dummy linux ${{ matrix.target }} artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-${{ matrix.target }}
|
||||
name: bindings-${{ matrix.target }}${{ matrix.uniffi }}
|
||||
path: ./*
|
||||
38
.github/workflows/build-bindings-windows.yml
vendored
38
.github/workflows/build-bindings-windows.yml
vendored
@@ -21,14 +21,35 @@ on:
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
uniffi-25:
|
||||
description: 'If true, builds additional bindings for Uniffi 0.25'
|
||||
required: false
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
name: Setup
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: set-matrix
|
||||
run: |
|
||||
if [ ${{ inputs.uniffi-25 }} == true ]; then
|
||||
echo "::set-output name=matrix::['', '-uniffi-25']"
|
||||
else
|
||||
echo "::set-output name=matrix::['']"
|
||||
fi
|
||||
outputs:
|
||||
uniffi-matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
|
||||
build:
|
||||
if: ${{ !inputs.use-dummy-binaries }}
|
||||
runs-on: windows-latest
|
||||
name: build ${{ matrix.target }}
|
||||
name: build ${{ matrix.target }}${{ matrix.uniffi }}
|
||||
needs: setup
|
||||
strategy:
|
||||
matrix:
|
||||
uniffi: ${{ fromJson(needs.setup.outputs.uniffi-matrix) }}
|
||||
target: [
|
||||
x86_64-pc-windows-msvc,
|
||||
]
|
||||
@@ -53,24 +74,33 @@ jobs:
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: ${{ matrix.uniffi }}
|
||||
workspaces: lib
|
||||
|
||||
- name: Build bindings
|
||||
if: matrix.uniffi != '-uniffi-25'
|
||||
working-directory: lib/bindings
|
||||
run: cargo build --release --target ${{ matrix.target }}
|
||||
|
||||
- name: Build bindings Uniffi 0.25
|
||||
if: matrix.uniffi == '-uniffi-25'
|
||||
working-directory: lib/bindings
|
||||
run: cargo build --no-default-features --features=uniffi-25 --release --target ${{ matrix.target }}
|
||||
|
||||
- name: Archive release
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-${{ matrix.target }}
|
||||
name: bindings-${{ matrix.target }}${{ matrix.uniffi }}
|
||||
path: lib/target/${{ matrix.target }}/release/breez_sdk_liquid_bindings.dll
|
||||
|
||||
build-dummies:
|
||||
if: ${{ inputs.use-dummy-binaries }}
|
||||
runs-on: ubuntu-latest
|
||||
name: build windows dummies
|
||||
name: build dummies ${{ matrix.target }}${{ matrix.uniffi }}
|
||||
needs: setup
|
||||
strategy:
|
||||
matrix:
|
||||
uniffi: ${{ fromJson(needs.setup.outputs.uniffi-matrix) }}
|
||||
target: [
|
||||
x86_64-pc-windows-msvc,
|
||||
]
|
||||
@@ -82,5 +112,5 @@ jobs:
|
||||
- name: Upload dummy windows ${{ matrix.target }} artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-${{ matrix.target }}
|
||||
name: bindings-${{ matrix.target }}${{ matrix.uniffi }}
|
||||
path: ./*
|
||||
57
.github/workflows/build-language-bindings.yml
vendored
57
.github/workflows/build-language-bindings.yml
vendored
@@ -60,6 +60,7 @@ on:
|
||||
jobs:
|
||||
build-language-bindings:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ inputs.kotlin || inputs.swift || inputs.python }}
|
||||
steps:
|
||||
- name: Checkout breez-sdk-liquid repo
|
||||
uses: actions/checkout@v4
|
||||
@@ -77,12 +78,16 @@ jobs:
|
||||
with:
|
||||
version: "27.2"
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: lib
|
||||
|
||||
- name: Build Kotlin binding
|
||||
if: ${{ inputs.kotlin }}
|
||||
working-directory: lib/bindings
|
||||
run: |
|
||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --language kotlin -o ffi/kotlin
|
||||
cargo run --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --language kotlin -o ffi/kotlin
|
||||
|
||||
- name: Archive Kotlin binding
|
||||
if: ${{ inputs.kotlin }}
|
||||
@@ -90,19 +95,12 @@ jobs:
|
||||
with:
|
||||
name: bindings-kotlin
|
||||
path: lib/bindings/ffi/kotlin/breez_sdk_liquid/breez_sdk_liquid.kt
|
||||
|
||||
- name: Archive Kotlin multiplatform binding
|
||||
if: ${{ inputs.kotlin }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-kotlin-multiplatform
|
||||
path: lib/bindings/ffi/kmp/*
|
||||
|
||||
- name: Build Swift binding
|
||||
if: ${{ inputs.swift }}
|
||||
working-directory: lib/bindings
|
||||
run: |
|
||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language swift --out-dir langs/swift/Sources/BreezSDKLiquid
|
||||
cargo run --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language swift --out-dir langs/swift/Sources/BreezSDKLiquid
|
||||
mv langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquid.swift langs/swift/Sources/BreezSDKLiquid/BreezSDKLiquid.swift
|
||||
|
||||
- name: Archive Swift binding
|
||||
@@ -116,7 +114,7 @@ jobs:
|
||||
if: ${{ inputs.python }}
|
||||
working-directory: lib/bindings
|
||||
run: |
|
||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --language python -o ffi/python
|
||||
cargo run --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --language python -o ffi/python
|
||||
|
||||
- name: Archive Python binding
|
||||
if: ${{ inputs.python }}
|
||||
@@ -125,6 +123,45 @@ jobs:
|
||||
name: bindings-python
|
||||
path: lib/bindings/ffi/python/breez_sdk_liquid.py
|
||||
|
||||
build-language-bindings-uniffi-25:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ inputs.kotlin || inputs.csharp || inputs.golang }}
|
||||
steps:
|
||||
- name: Checkout breez-sdk-liquid repo
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: ${{ inputs.repository || github.repository }}
|
||||
ref: ${{ inputs.ref || github.sha }}
|
||||
|
||||
- name: Install rust
|
||||
run: |
|
||||
rustup set auto-self-update disable
|
||||
rustup toolchain install stable --profile minimal
|
||||
|
||||
- name: Install Protoc
|
||||
uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
version: "27.2"
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: uniffi-25
|
||||
workspaces: lib
|
||||
|
||||
- name: Build Kotlin binding
|
||||
if: ${{ inputs.kotlin }}
|
||||
working-directory: lib/bindings
|
||||
run: |
|
||||
cargo run --no-default-features --features=uniffi-25 --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --language kotlin -o ffi/kotlin
|
||||
|
||||
- name: Archive Kotlin multiplatform binding
|
||||
if: ${{ inputs.kotlin }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: bindings-kotlin-multiplatform
|
||||
path: lib/bindings/ffi/kmp/*
|
||||
|
||||
- name: Build C# binding
|
||||
if: ${{ inputs.csharp }}
|
||||
working-directory: lib/bindings
|
||||
|
||||
65
.github/workflows/main.yml
vendored
65
.github/workflows/main.yml
vendored
@@ -153,15 +153,55 @@ jobs:
|
||||
version: "27.2"
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Setup python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Build bindings
|
||||
working-directory: lib/bindings
|
||||
run: cargo build
|
||||
|
||||
- name: Run bindings tests
|
||||
run: |
|
||||
curl -o jna-5.12.1.jar https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.12.1/jna-5.12.1.jar
|
||||
export CLASSPATH=$(pwd)/jna-5.12.1.jar;
|
||||
cd lib/bindings
|
||||
cargo test
|
||||
|
||||
build-bindings-uniffi-25:
|
||||
name: Test bindings Uniffi 0.25
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: -uniffi-25
|
||||
workspaces: |
|
||||
lib -> target
|
||||
cli -> target
|
||||
|
||||
- name: Install Protoc
|
||||
uses: arduino/setup-protoc@v3
|
||||
with:
|
||||
version: "27.2"
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Setup dotnet
|
||||
if: ${{ !inputs.skip-tests }}
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: '7.0.x'
|
||||
|
||||
- name: Setup go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.19.9'
|
||||
|
||||
- name: Build bindings
|
||||
working-directory: lib/bindings
|
||||
run: cargo build
|
||||
run: cargo build --no-default-features --features uniffi-25
|
||||
|
||||
- name: Build C# bindings
|
||||
working-directory: lib/bindings
|
||||
@@ -178,22 +218,9 @@ jobs:
|
||||
cp ../target/debug/libbreez_sdk_liquid_bindings.so ffi/golang
|
||||
cp -r ffi/golang/breez_sdk_liquid tests/bindings/golang/
|
||||
|
||||
- name: Setup go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: '1.19.9'
|
||||
|
||||
- name: Setup python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Run bindings tests
|
||||
run: |
|
||||
curl -o jna-5.12.1.jar https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.12.1/jna-5.12.1.jar
|
||||
export CLASSPATH=$(pwd)/jna-5.12.1.jar;
|
||||
cd lib/bindings
|
||||
cargo test
|
||||
working-directory: lib/bindings
|
||||
run: cargo test --no-default-features --features uniffi-25
|
||||
|
||||
build-wasm:
|
||||
name: Test WASM
|
||||
@@ -255,7 +282,7 @@ jobs:
|
||||
- name: Build Android bindings
|
||||
working-directory: lib/bindings
|
||||
run: |
|
||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language kotlin -o langs/android/lib/src/main/kotlin
|
||||
cargo run --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language kotlin -o langs/android/lib/src/main/kotlin
|
||||
|
||||
- name: Run Android build
|
||||
working-directory: lib/bindings/langs/android
|
||||
@@ -265,7 +292,7 @@ jobs:
|
||||
- name: Build Swift bindings
|
||||
working-directory: lib/bindings
|
||||
run: |
|
||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language swift -o langs/swift/Sources/BreezSDKLiquid
|
||||
cargo run --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language swift -o langs/swift/Sources/BreezSDKLiquid
|
||||
mv langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquid.swift langs/swift/Sources/BreezSDKLiquid/BreezSDKLiquid.swift
|
||||
cp langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquidFFI.h langs/swift/breez_sdk_liquidFFI.xcframework/ios-arm64/breez_sdk_liquidFFI.framework/Headers
|
||||
cp langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquidFFI.h langs/swift/breez_sdk_liquidFFI.xcframework/ios-arm64_x86_64-simulator/breez_sdk_liquidFFI.framework/Headers
|
||||
|
||||
6
.github/workflows/publish-all-platforms.yml
vendored
6
.github/workflows/publish-all-platforms.yml
vendored
@@ -121,6 +121,7 @@ jobs:
|
||||
swift-package-version: ${{ needs.pre-setup.outputs.swift-package-version || '0.0.2' }}
|
||||
publish: ${{ needs.pre-setup.outputs.publish }}
|
||||
use-dummy-binaries: ${{ needs.pre-setup.outputs.use-dummy-binaries }}
|
||||
uniffi-25: ${{ !!needs.pre-setup.outputs.csharp-package-version || !!needs.pre-setup.outputs.golang-package-version || !!needs.pre-setup.outputs.kotlin-multiplatform-package-version }}
|
||||
steps:
|
||||
- run: echo "set setup output variables"
|
||||
|
||||
@@ -132,6 +133,7 @@ jobs:
|
||||
repository: ${{ needs.setup.outputs.repository }}
|
||||
ref: ${{ needs.setup.outputs.ref }}
|
||||
use-dummy-binaries: ${{ needs.setup.outputs.use-dummy-binaries == 'true' }}
|
||||
uniffi-25: ${{ needs.setup.outputs.uniffi-25 == 'true' }}
|
||||
|
||||
build-bindings-darwin:
|
||||
needs: setup
|
||||
@@ -141,6 +143,7 @@ jobs:
|
||||
repository: ${{ needs.setup.outputs.repository }}
|
||||
ref: ${{ needs.setup.outputs.ref }}
|
||||
use-dummy-binaries: ${{ needs.setup.outputs.use-dummy-binaries == 'true' }}
|
||||
uniffi-25: ${{ needs.setup.outputs.uniffi-25 == 'true' }}
|
||||
|
||||
build-bindings-linux:
|
||||
needs: setup
|
||||
@@ -150,6 +153,7 @@ jobs:
|
||||
repository: ${{ needs.setup.outputs.repository }}
|
||||
ref: ${{ needs.setup.outputs.ref }}
|
||||
use-dummy-binaries: ${{ needs.setup.outputs.use-dummy-binaries == 'true' }}
|
||||
uniffi-25: ${{ needs.setup.outputs.uniffi-25 == 'true' }}
|
||||
|
||||
build-bindings-android:
|
||||
needs: setup
|
||||
@@ -159,6 +163,7 @@ jobs:
|
||||
repository: ${{ needs.setup.outputs.repository }}
|
||||
ref: ${{ needs.setup.outputs.ref }}
|
||||
use-dummy-binaries: ${{ needs.setup.outputs.use-dummy-binaries == 'true' }}
|
||||
uniffi-25: ${{ needs.setup.outputs.uniffi-25 == 'true' }}
|
||||
|
||||
build-bindings-ios:
|
||||
needs: setup
|
||||
@@ -168,6 +173,7 @@ jobs:
|
||||
repository: ${{ needs.setup.outputs.repository }}
|
||||
ref: ${{ needs.setup.outputs.ref }}
|
||||
use-dummy-binaries: ${{ needs.setup.outputs.use-dummy-binaries == 'true' }}
|
||||
uniffi-25: ${{ needs.setup.outputs.uniffi-25 == 'true' }}
|
||||
|
||||
build-language-bindings:
|
||||
needs: setup
|
||||
|
||||
10
.github/workflows/publish-csharp.yml
vendored
10
.github/workflows/publish-csharp.yml
vendored
@@ -46,27 +46,27 @@ jobs:
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-aarch64-apple-darwin
|
||||
name: bindings-aarch64-apple-darwin-uniffi-25
|
||||
path: lib/bindings/langs/csharp/src/runtimes/osx-arm64/native
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-x86_64-apple-darwin
|
||||
name: bindings-x86_64-apple-darwin-uniffi-25
|
||||
path: lib/bindings/langs/csharp/src/runtimes/osx-x64/native
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-aarch64-unknown-linux-gnu
|
||||
name: bindings-aarch64-unknown-linux-gnu-uniffi-25
|
||||
path: lib/bindings/langs/csharp/src/runtimes/linux-arm64/native
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-x86_64-unknown-linux-gnu
|
||||
name: bindings-x86_64-unknown-linux-gnu-uniffi-25
|
||||
path: lib/bindings/langs/csharp/src/runtimes/linux-x64/native
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-x86_64-pc-windows-msvc
|
||||
name: bindings-x86_64-pc-windows-msvc-uniffi-25
|
||||
path: lib/bindings/langs/csharp/src/runtimes/win-x64/native
|
||||
|
||||
- name: Update package version
|
||||
|
||||
14
.github/workflows/publish-golang.yml
vendored
14
.github/workflows/publish-golang.yml
vendored
@@ -38,37 +38,37 @@ jobs:
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-aarch64-linux-android
|
||||
name: bindings-aarch64-linux-android-uniffi-25
|
||||
path: breez_sdk_liquid/lib/android-aarch64
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-x86_64-linux-android
|
||||
name: bindings-x86_64-linux-android-uniffi-25
|
||||
path: breez_sdk_liquid/lib/android-amd64
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-aarch64-apple-darwin
|
||||
name: bindings-aarch64-apple-darwin-uniffi-25
|
||||
path: breez_sdk_liquid/lib/darwin-aarch64
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-x86_64-apple-darwin
|
||||
name: bindings-x86_64-apple-darwin-uniffi-25
|
||||
path: breez_sdk_liquid/lib/darwin-amd64
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-aarch64-unknown-linux-gnu
|
||||
name: bindings-aarch64-unknown-linux-gnu-uniffi-25
|
||||
path: breez_sdk_liquid/lib/linux-aarch64
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-x86_64-unknown-linux-gnu
|
||||
name: bindings-x86_64-unknown-linux-gnu-uniffi-25
|
||||
path: breez_sdk_liquid/lib/linux-amd64
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-x86_64-pc-windows-msvc
|
||||
name: bindings-x86_64-pc-windows-msvc-uniffi-25
|
||||
path: breez_sdk_liquid/lib/windows-amd64
|
||||
|
||||
- name: Archive Go release
|
||||
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-android-jniLibs
|
||||
name: bindings-android-jniLibs-uniffi-25
|
||||
path: lib/bindings/langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/androidMain/jniLibs
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
@@ -59,17 +59,17 @@ jobs:
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-aarch64-apple-ios
|
||||
name: bindings-aarch64-apple-ios-uniffi-25
|
||||
path: lib/bindings/langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/lib/ios-arm64
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-aarch64-apple-ios-sim
|
||||
name: bindings-aarch64-apple-ios-sim-uniffi-25
|
||||
path: lib/bindings/langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/lib/ios-simulator-arm64
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: bindings-x86_64-apple-ios
|
||||
name: bindings-x86_64-apple-ios-uniffi-25
|
||||
path: lib/bindings/langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/lib/ios-simulator-x64
|
||||
|
||||
- name: Build Kotlin Multiplatform project
|
||||
|
||||
1
lib/.gitignore
vendored
1
lib/.gitignore
vendored
@@ -5,3 +5,4 @@ target
|
||||
*.so
|
||||
*.a
|
||||
bindings/ffi
|
||||
bindings/testnet
|
||||
|
||||
196
lib/Cargo.lock
generated
196
lib/Cargo.lock
generated
@@ -856,7 +856,9 @@ dependencies = [
|
||||
"thiserror 1.0.63",
|
||||
"tokio",
|
||||
"uniffi 0.25.3",
|
||||
"uniffi 0.28.0",
|
||||
"uniffi_bindgen 0.25.3",
|
||||
"uniffi_bindgen 0.28.0",
|
||||
"uniffi_bindgen_kotlin_multiplatform",
|
||||
]
|
||||
|
||||
@@ -1869,7 +1871,18 @@ checksum = "0d6b4de4a8eb6c46a8c77e1d3be942cb9a8bf073c22374578e5ba4b08ed0ff68"
|
||||
dependencies = [
|
||||
"log",
|
||||
"plain",
|
||||
"scroll",
|
||||
"scroll 0.11.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "goblin"
|
||||
version = "0.8.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47"
|
||||
dependencies = [
|
||||
"log",
|
||||
"plain",
|
||||
"scroll 0.12.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4130,7 +4143,16 @@ version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da"
|
||||
dependencies = [
|
||||
"scroll_derive",
|
||||
"scroll_derive 0.11.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scroll"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6"
|
||||
dependencies = [
|
||||
"scroll_derive 0.12.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -4144,6 +4166,17 @@ dependencies = [
|
||||
"syn 2.0.98",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scroll_derive"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.98",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scrypt"
|
||||
version = "0.11.0"
|
||||
@@ -4449,6 +4482,12 @@ version = "1.13.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
|
||||
|
||||
[[package]]
|
||||
name = "smawk"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c"
|
||||
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
version = "0.5.7"
|
||||
@@ -4644,6 +4683,9 @@ name = "textwrap"
|
||||
version = "0.16.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9"
|
||||
dependencies = [
|
||||
"smawk",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
@@ -5222,6 +5264,21 @@ dependencies = [
|
||||
"uniffi_macros 0.25.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi"
|
||||
version = "0.28.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f31bff6daf87277a9014bcdefbc2842b0553392919d1096843c5aad899ca4588"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"camino",
|
||||
"clap 4.5.17",
|
||||
"uniffi_bindgen 0.28.0",
|
||||
"uniffi_build 0.28.0",
|
||||
"uniffi_core 0.28.0",
|
||||
"uniffi_macros 0.28.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi_bindgen"
|
||||
version = "0.23.0"
|
||||
@@ -5234,7 +5291,7 @@ dependencies = [
|
||||
"camino",
|
||||
"fs-err",
|
||||
"glob",
|
||||
"goblin",
|
||||
"goblin 0.6.1",
|
||||
"heck 0.4.1",
|
||||
"once_cell",
|
||||
"paste",
|
||||
@@ -5243,7 +5300,7 @@ dependencies = [
|
||||
"toml",
|
||||
"uniffi_meta 0.23.0",
|
||||
"uniffi_testing 0.23.0",
|
||||
"weedle2",
|
||||
"weedle2 4.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5259,7 +5316,7 @@ dependencies = [
|
||||
"clap 4.5.17",
|
||||
"fs-err",
|
||||
"glob",
|
||||
"goblin",
|
||||
"goblin 0.6.1",
|
||||
"heck 0.4.1",
|
||||
"once_cell",
|
||||
"paste",
|
||||
@@ -5267,7 +5324,31 @@ dependencies = [
|
||||
"toml",
|
||||
"uniffi_meta 0.25.3",
|
||||
"uniffi_testing 0.25.3",
|
||||
"uniffi_udl",
|
||||
"uniffi_udl 0.25.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi_bindgen"
|
||||
version = "0.28.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "96061d7e01b185aa405f7c9b134741ab3e50cc6796a47d6fd8ab9a5364b5feed"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"askama 0.12.1",
|
||||
"camino",
|
||||
"cargo_metadata",
|
||||
"fs-err",
|
||||
"glob",
|
||||
"goblin 0.8.2",
|
||||
"heck 0.5.0",
|
||||
"once_cell",
|
||||
"paste",
|
||||
"serde",
|
||||
"textwrap",
|
||||
"toml",
|
||||
"uniffi_meta 0.28.0",
|
||||
"uniffi_testing 0.28.0",
|
||||
"uniffi_udl 0.28.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5309,6 +5390,17 @@ dependencies = [
|
||||
"uniffi_bindgen 0.25.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi_build"
|
||||
version = "0.28.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9d6b86f9b221046af0c533eafe09ece04e2f1ded04ccdc9bba0ec09aec1c52bd"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"camino",
|
||||
"uniffi_bindgen 0.28.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi_checksum_derive"
|
||||
version = "0.23.0"
|
||||
@@ -5329,6 +5421,16 @@ dependencies = [
|
||||
"syn 2.0.98",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi_checksum_derive"
|
||||
version = "0.28.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "802d2051a700e3ec894c79f80d2705b69d85844dafbbe5d1a92776f8f48b563a"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"syn 2.0.98",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi_core"
|
||||
version = "0.23.0"
|
||||
@@ -5361,6 +5463,21 @@ dependencies = [
|
||||
"static_assertions",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi_core"
|
||||
version = "0.28.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3210d57d6ab6065ab47a2898dacdb7c606fd6a4156196831fa3bf82e34ac58a6"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytes",
|
||||
"camino",
|
||||
"log",
|
||||
"once_cell",
|
||||
"paste",
|
||||
"static_assertions",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi_macros"
|
||||
version = "0.23.0"
|
||||
@@ -5399,6 +5516,24 @@ dependencies = [
|
||||
"uniffi_meta 0.25.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi_macros"
|
||||
version = "0.28.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b58691741080935437dc862122e68d7414432a11824ac1137868de46181a0bd2"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"camino",
|
||||
"fs-err",
|
||||
"once_cell",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde",
|
||||
"syn 2.0.98",
|
||||
"toml",
|
||||
"uniffi_meta 0.28.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi_meta"
|
||||
version = "0.23.0"
|
||||
@@ -5422,6 +5557,18 @@ dependencies = [
|
||||
"uniffi_checksum_derive 0.25.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi_meta"
|
||||
version = "0.28.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7663eacdbd9fbf4a88907ddcfe2e6fa85838eb6dc2418a7d91eebb3786f8e20b"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bytes",
|
||||
"siphasher",
|
||||
"uniffi_checksum_derive 0.28.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi_testing"
|
||||
version = "0.23.0"
|
||||
@@ -5450,6 +5597,19 @@ dependencies = [
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi_testing"
|
||||
version = "0.28.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f922465f7566f25f8fe766920205fdfa9a3fcdc209c6bfb7557f0b5bf45b04dd"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"camino",
|
||||
"cargo_metadata",
|
||||
"fs-err",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi_udl"
|
||||
version = "0.25.3"
|
||||
@@ -5459,7 +5619,20 @@ dependencies = [
|
||||
"anyhow",
|
||||
"uniffi_meta 0.25.3",
|
||||
"uniffi_testing 0.25.3",
|
||||
"weedle2",
|
||||
"weedle2 4.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uniffi_udl"
|
||||
version = "0.28.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cef408229a3a407fafa4c36dc4f6ece78a6fb258ab28d2b64bddd49c8cb680f6"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"textwrap",
|
||||
"uniffi_meta 0.28.0",
|
||||
"uniffi_testing 0.28.0",
|
||||
"weedle2 5.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -5752,6 +5925,15 @@ dependencies = [
|
||||
"nom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "weedle2"
|
||||
version = "5.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "998d2c24ec099a87daf9467808859f9d82b61f1d9c9701251aea037f514eae0e"
|
||||
dependencies = [
|
||||
"nom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "which"
|
||||
version = "4.4.2"
|
||||
|
||||
@@ -40,8 +40,6 @@ serde = { version = "1.0", features = ["derive"] }
|
||||
sdk-common = { git = "https://github.com/breez/breez-sdk", rev = "0017f7d3f76a1f0094ad9ff25422b72c31acc60e", features = ["liquid"] }
|
||||
sdk-macros = { git = "https://github.com/breez/breez-sdk", rev = "0017f7d3f76a1f0094ad9ff25422b72c31acc60e" }
|
||||
thiserror = "1.0"
|
||||
# Version must match that used by uniffi-bindgen-go
|
||||
uniffi = "0.25.0"
|
||||
|
||||
[patch.crates-io]
|
||||
# https://github.com/BlockstreamResearch/rust-secp256k1-zkp/pull/48/commits and rebased on secp256k1-zkp 0.11.0
|
||||
|
||||
@@ -11,6 +11,11 @@ path = "uniffi-bindgen.rs"
|
||||
name = "breez_sdk_liquid_bindings"
|
||||
crate-type = ["staticlib", "cdylib", "lib"]
|
||||
|
||||
[features]
|
||||
default = ["uniffi-28"]
|
||||
uniffi-25 = ["uniffi_25", "uniffi_bindgen_25", "uniffi_bindgen_kotlin_multiplatform"]
|
||||
uniffi-28 = ["uniffi_28", "uniffi_bindgen_28"]
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -18,15 +23,17 @@ workspace = true
|
||||
anyhow = { workspace = true }
|
||||
breez-sdk-liquid = { path = "../core" }
|
||||
log = { workspace = true }
|
||||
uniffi = { workspace = true, features = [ "bindgen-tests", "cli" ] }
|
||||
# Bindgen used by KMP, version has to match the one supported by KMP
|
||||
uniffi_bindgen = "0.25.2"
|
||||
uniffi_bindgen_kotlin_multiplatform = { git = "https://gitlab.com/trixnity/uniffi-kotlin-multiplatform-bindings", rev = "e8e3a88df5b657787c1198425c16008232b26548" }
|
||||
uniffi_25 = { package = "uniffi", version = "0.25.2", features = [ "bindgen-tests", "cli" ], optional = true }
|
||||
uniffi_28 = { package = "uniffi", version = "0.28.0", features = [ "bindgen-tests", "cli" ], optional = true }
|
||||
uniffi_bindgen_25 = { package = "uniffi_bindgen", version = "0.25.2", optional = true }
|
||||
uniffi_bindgen_28 = { package = "uniffi_bindgen", version = "0.28.0", optional = true }
|
||||
uniffi_bindgen_kotlin_multiplatform = { git = "https://gitlab.com/trixnity/uniffi-kotlin-multiplatform-bindings", rev = "e8e3a88df5b657787c1198425c16008232b26548", optional = true }
|
||||
camino = "1.1.1"
|
||||
thiserror = { workspace = true }
|
||||
tokio = { version = "1", features = ["rt"] }
|
||||
once_cell = { workspace = true }
|
||||
|
||||
[build-dependencies]
|
||||
uniffi = { workspace = true, features = [ "build" ] }
|
||||
glob = "0.3.1"
|
||||
uniffi_25 = { package = "uniffi", version = "0.25.2", features = [ "build" ], optional = true }
|
||||
uniffi_28 = { package = "uniffi", version = "0.28.0", features = [ "build" ], optional = true }
|
||||
glob = "0.3.1"
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
#[cfg(feature = "uniffi-25")]
|
||||
extern crate uniffi_25 as uniffi;
|
||||
#[cfg(feature = "uniffi-28")]
|
||||
extern crate uniffi_28 as uniffi;
|
||||
|
||||
use glob::glob;
|
||||
use std::env;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ android {
|
||||
compileSdk = 34
|
||||
|
||||
defaultConfig {
|
||||
minSdk = 24
|
||||
minSdk = 33
|
||||
consumerProguardFiles("consumer-rules.pro")
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -37,16 +37,27 @@ all: bindings-swift bindings-android python-darwin react-native
|
||||
## Android
|
||||
.PHONY: android
|
||||
android: aarch64-linux-android x86_64-linux-android
|
||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language kotlin -o ffi/kotlin
|
||||
cargo run --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language kotlin -o ffi/kotlin
|
||||
|
||||
android-uniffi-25: aarch64-linux-android-uniffi-25 x86_64-linux-android-uniffi-25
|
||||
cargo run --no-default-features --features=uniffi-25 --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language kotlin -o ffi/kotlin
|
||||
|
||||
aarch64-linux-android: $(SOURCES) ndk-home
|
||||
cargo ndk -t aarch64-linux-android -o ffi/kotlin/jniLibs build --release
|
||||
cp -a $(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so ffi/kotlin/jniLibs/arm64-v8a/
|
||||
|
||||
aarch64-linux-android-uniffi-25: $(SOURCES) ndk-home
|
||||
cargo ndk -t aarch64-linux-android -o ffi/kotlin/jniLibs build --no-default-features --features=uniffi-25 --release
|
||||
cp -a $(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so ffi/kotlin/jniLibs/arm64-v8a/
|
||||
|
||||
x86_64-linux-android: $(SOURCES) ndk-home
|
||||
cargo ndk -t x86_64-linux-android -o ffi/kotlin/jniLibs build --release
|
||||
cp -a $(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/sysroot/usr/lib/x86_64-linux-android/libc++_shared.so ffi/kotlin/jniLibs/x86_64/
|
||||
|
||||
x86_64-linux-android-uniffi-25: $(SOURCES) ndk-home
|
||||
cargo ndk -t x86_64-linux-android -o ffi/kotlin/jniLibs build --no-default-features --features=uniffi-25 --release
|
||||
cp -a $(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/$(OS_NAME)-x86_64/sysroot/usr/lib/x86_64-linux-android/libc++_shared.so ffi/kotlin/jniLibs/x86_64/
|
||||
|
||||
bindings-android: android
|
||||
cp -r ffi/kotlin/jniLibs langs/android/lib/src/main
|
||||
cp -r ffi/kotlin/breez_sdk_liquid langs/android/lib/src/main/kotlin/
|
||||
@@ -58,9 +69,9 @@ bindings-android: android
|
||||
.PHONY: kotlin
|
||||
kotlin: $(SOURCES)
|
||||
cargo build --release --target $(TARGET)
|
||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language kotlin -o ffi/kotlin
|
||||
cargo run --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language kotlin -o ffi/kotlin
|
||||
|
||||
bindings-kotlin-multiplatform: ios-universal android
|
||||
bindings-kotlin-multiplatform: ios-universal-uniffi-25 android-uniffi-25
|
||||
mkdir -p langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/androidMain
|
||||
cp -r ffi/kotlin/jniLibs/ langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/androidMain/jniLibs/
|
||||
cp -r ffi/kmp/* langs/kotlin-multiplatform/breez-sdk-liquid-kmp/src/
|
||||
@@ -88,6 +99,17 @@ ios-universal: $(SOURCES)
|
||||
# build universal lib for arm sim and x86 sim
|
||||
lipo -create -output ../target/ios-universal-sim/release/libbreez_sdk_liquid_bindings.a ../target/aarch64-apple-ios-sim/release/libbreez_sdk_liquid_bindings.a ../target/x86_64-apple-ios/release/libbreez_sdk_liquid_bindings.a
|
||||
|
||||
ios-universal-uniffi-25: $(SOURCES)
|
||||
mkdir -p ../target/ios-universal/release
|
||||
mkdir -p ../target/ios-universal-sim/release
|
||||
cargo build --no-default-features --features uniffi-25 --release --target aarch64-apple-ios ;\
|
||||
cargo build --no-default-features --features uniffi-25 --release --target x86_64-apple-ios ;\
|
||||
cargo build --no-default-features --features uniffi-25 --release --target aarch64-apple-ios-sim ;\
|
||||
# build universal lib for arm device and x86 sim
|
||||
lipo -create -output ../target/ios-universal/release/libbreez_sdk_liquid_bindings.a ../target/aarch64-apple-ios/release/libbreez_sdk_liquid_bindings.a ../target/x86_64-apple-ios/release/libbreez_sdk_liquid_bindings.a
|
||||
# build universal lib for arm sim and x86 sim
|
||||
lipo -create -output ../target/ios-universal-sim/release/libbreez_sdk_liquid_bindings.a ../target/aarch64-apple-ios-sim/release/libbreez_sdk_liquid_bindings.a ../target/x86_64-apple-ios/release/libbreez_sdk_liquid_bindings.a
|
||||
|
||||
darwin-universal: $(SOURCES)
|
||||
mkdir -p ../target/darwin-universal/release
|
||||
cargo lipo --release --targets aarch64-apple-darwin
|
||||
@@ -95,14 +117,21 @@ darwin-universal: $(SOURCES)
|
||||
lipo -create -output ../target/darwin-universal/release/libbreez_sdk_liquid_bindings.dylib ../target/aarch64-apple-darwin/release/libbreez_sdk_liquid_bindings.dylib ../target/x86_64-apple-darwin/release/libbreez_sdk_liquid_bindings.dylib
|
||||
lipo -create -output ../target/darwin-universal/release/libbreez_sdk_liquid_bindings.a ../target/aarch64-apple-darwin/release/libbreez_sdk_liquid_bindings.a ../target/x86_64-apple-darwin/release/libbreez_sdk_liquid_bindings.a
|
||||
|
||||
darwin-universal-uniffi-25: $(SOURCES)
|
||||
mkdir -p ../target/darwin-universal/release
|
||||
cargo lipo --no-default-features --features uniffi-25 --release --targets aarch64-apple-darwin
|
||||
cargo lipo --no-default-features --features uniffi-25 --release --targets x86_64-apple-darwin
|
||||
lipo -create -output ../target/darwin-universal/release/libbreez_sdk_liquid_bindings.dylib ../target/aarch64-apple-darwin/release/libbreez_sdk_liquid_bindings.dylib ../target/x86_64-apple-darwin/release/libbreez_sdk_liquid_bindings.dylib
|
||||
lipo -create -output ../target/darwin-universal/release/libbreez_sdk_liquid_bindings.a ../target/aarch64-apple-darwin/release/libbreez_sdk_liquid_bindings.a ../target/x86_64-apple-darwin/release/libbreez_sdk_liquid_bindings.a
|
||||
|
||||
## Swift
|
||||
swift-ios: ios-universal
|
||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl -l swift -o ffi/swift-ios
|
||||
cargo run --bin uniffi-bindgen generate src/breez_sdk_liquid.udl -l swift -o ffi/swift-ios
|
||||
cp ../target/ios-universal/release/libbreez_sdk_liquid_bindings.a ffi/swift-ios
|
||||
cd ffi/swift-ios && "swiftc" "-emit-module" "-module-name" "breez_sdk_liquid_bindings" "-Xcc" "-fmodule-map-file=$(CURRENT_DIR)/ffi/swift-ios/breez_sdk_liquidFFI.modulemap" "-I" "." "-L" "." "-lbreez_sdk_liquid_bindings" breez_sdk_liquid.swift
|
||||
|
||||
swift-darwin: darwin-universal
|
||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl -l swift -o ffi/swift-darwin
|
||||
cargo run --bin uniffi-bindgen generate src/breez_sdk_liquid.udl -l swift -o ffi/swift-darwin
|
||||
cp ../target/darwin-universal/release/libbreez_sdk_liquid_bindings.dylib ffi/swift-darwin
|
||||
cd ffi/swift-darwin && "swiftc" "-emit-module" "-module-name" "breez_sdk_liquid_bindings" "-Xcc" "-fmodule-map-file=$(CURRENT_DIR)/ffi/swift-darwin/breez_sdk_liquidFFI.modulemap" "-I" "." "-L" "." "-lbreez_sdk_liquid_bindings" breez_sdk_liquid.swift
|
||||
|
||||
@@ -110,7 +139,7 @@ bindings-swift: ios-universal darwin-universal build-ios-framework
|
||||
|
||||
build-ios-framework:
|
||||
mkdir -p langs/swift/Sources/BreezSDKLiquid
|
||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language swift -o langs/swift/Sources/BreezSDKLiquid
|
||||
cargo run --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language swift -o langs/swift/Sources/BreezSDKLiquid
|
||||
mv langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquid.swift langs/swift/Sources/BreezSDKLiquid/BreezSDKLiquid.swift
|
||||
cp langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquidFFI.h langs/swift/breez_sdk_liquidFFI.xcframework/ios-arm64/breez_sdk_liquidFFI.framework/Headers
|
||||
cp langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquidFFI.h langs/swift/breez_sdk_liquidFFI.xcframework/ios-arm64_x86_64-simulator/breez_sdk_liquidFFI.framework/Headers
|
||||
@@ -122,19 +151,19 @@ build-ios-framework:
|
||||
rm langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquidFFI.h
|
||||
rm langs/swift/Sources/BreezSDKLiquid/breez_sdk_liquidFFI.modulemap
|
||||
|
||||
csharp-darwin: darwin-universal
|
||||
csharp-darwin: darwin-universal-uniffi-25
|
||||
cargo install uniffi-bindgen-cs --git https://github.com/NordSecurity/uniffi-bindgen-cs --tag v0.8.0+v0.25.0
|
||||
uniffi-bindgen-cs src/breez_sdk_liquid.udl -o ffi/csharp -c ./uniffi.toml
|
||||
cp ../target/darwin-universal/release/libbreez_sdk_liquid_bindings.dylib ffi/csharp
|
||||
|
||||
csharp-linux: $(SOURCES)
|
||||
cargo install uniffi-bindgen-cs --git https://github.com/NordSecurity/uniffi-bindgen-cs --tag v0.8.0+v0.25.0
|
||||
cargo build --release --target $(TARGET)
|
||||
cargo build --no-default-features --features uniffi-25 --release --target $(TARGET)
|
||||
uniffi-bindgen-cs src/breez_sdk_liquid.udl -o ffi/csharp -c ./uniffi.toml
|
||||
cp ../target/$(TARGET)/release/libbreez_sdk_liquid_bindings.so ffi/csharp
|
||||
|
||||
## Go
|
||||
golang-darwin: darwin-universal
|
||||
golang-darwin: darwin-universal-uniffi-25
|
||||
cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.2.1+v0.25.0
|
||||
uniffi-bindgen-go src/breez_sdk_liquid.udl -o ffi/golang -c ./uniffi.toml
|
||||
cp ../target/darwin-universal/release/libbreez_sdk_liquid_bindings.dylib ffi/golang
|
||||
@@ -142,7 +171,7 @@ golang-darwin: darwin-universal
|
||||
|
||||
golang-linux: $(SOURCES)
|
||||
cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.2.1+v0.25.0
|
||||
cargo build --release --target $(TARGET)
|
||||
cargo build --no-default-features --features uniffi-25 --release --target $(TARGET)
|
||||
uniffi-bindgen-go src/breez_sdk_liquid.udl -o ffi/golang -c ./uniffi.toml
|
||||
cp ../target/$(TARGET)/release/libbreez_sdk_liquid_bindings.so ffi/golang
|
||||
cp -r ffi/golang/breez_sdk_liquid tests/bindings/golang/
|
||||
@@ -150,11 +179,11 @@ golang-linux: $(SOURCES)
|
||||
## Python
|
||||
python-linux: $(SOURCES)
|
||||
cargo build --release --target $(TARGET)
|
||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language python -o ffi/python
|
||||
cargo run --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language python -o ffi/python
|
||||
cp ../target/$(TARGET)/release/libbreez_sdk_liquid_bindings.so ffi/python
|
||||
|
||||
python-darwin: darwin-universal
|
||||
cargo run --features=uniffi/cli --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language python -o ffi/python
|
||||
cargo run --bin uniffi-bindgen generate src/breez_sdk_liquid.udl --no-format --language python -o ffi/python
|
||||
cp ../target/darwin-universal/release/libbreez_sdk_liquid_bindings.dylib ffi/python
|
||||
|
||||
## React Native
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
//! Uniffi bindings
|
||||
#[cfg(feature = "uniffi-25")]
|
||||
extern crate uniffi_25 as uniffi;
|
||||
#[cfg(feature = "uniffi-28")]
|
||||
extern crate uniffi_28 as uniffi;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
#[cfg(feature = "uniffi-28")]
|
||||
extern crate uniffi_28 as uniffi;
|
||||
|
||||
#[cfg(feature = "uniffi-25")]
|
||||
use std::process::Command;
|
||||
|
||||
#[cfg(feature = "uniffi-28")]
|
||||
uniffi::build_foreign_language_testcases!(
|
||||
"tests/bindings/test_breez_sdk_liquid.swift",
|
||||
"tests/bindings/test_breez_sdk_liquid.kts",
|
||||
@@ -7,6 +12,7 @@ uniffi::build_foreign_language_testcases!(
|
||||
);
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "uniffi-25")]
|
||||
fn test_csharp() {
|
||||
let output = Command::new("dotnet")
|
||||
.arg("run")
|
||||
@@ -21,6 +27,7 @@ fn test_csharp() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "uniffi-25")]
|
||||
fn test_golang() {
|
||||
let output = Command::new("go")
|
||||
.env(
|
||||
|
||||
@@ -1,14 +1,26 @@
|
||||
#[cfg(feature = "uniffi-25")]
|
||||
extern crate uniffi_25 as uniffi;
|
||||
#[cfg(feature = "uniffi-28")]
|
||||
extern crate uniffi_28 as uniffi;
|
||||
#[cfg(feature = "uniffi-25")]
|
||||
extern crate uniffi_bindgen_25 as uniffi_bindgen;
|
||||
|
||||
#[cfg(feature = "uniffi-25")]
|
||||
use camino::Utf8Path;
|
||||
use uniffi_bindgen_kotlin_multiplatform::KotlinBindingGenerator;
|
||||
|
||||
fn main() {
|
||||
uniffi::uniffi_bindgen_main();
|
||||
#[cfg(feature = "uniffi-25")]
|
||||
build_kmp()
|
||||
}
|
||||
|
||||
#[cfg(feature = "uniffi-25")]
|
||||
fn build_kmp() {
|
||||
let udl_file = "./src/breez_sdk_liquid.udl";
|
||||
let out_dir = Utf8Path::new("ffi/kmp");
|
||||
let config = Utf8Path::new("uniffi.toml");
|
||||
uniffi_bindgen::generate_external_bindings(
|
||||
KotlinBindingGenerator {},
|
||||
uniffi_bindgen_kotlin_multiplatform::KotlinBindingGenerator {},
|
||||
udl_file,
|
||||
Some(config),
|
||||
Some(out_dir),
|
||||
|
||||
@@ -10,6 +10,9 @@ crate-type = ["lib", "cdylib", "staticlib"]
|
||||
[features]
|
||||
default = ["frb"]
|
||||
frb = ["dep:flutter_rust_bridge"]
|
||||
# Uniffi features required to build using cargo-lipo
|
||||
uniffi-25 = []
|
||||
uniffi-28 = []
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -577,8 +577,6 @@ pub mod duplicates {
|
||||
use serde::{Deserialize, Serialize};
|
||||
use thiserror::Error;
|
||||
|
||||
use crate::error::PaymentError;
|
||||
|
||||
#[derive(Clone, Debug, Error)]
|
||||
pub enum LnUrlPayError {
|
||||
/// This error is raised when attempting to pay an invoice that has already being paid.
|
||||
@@ -669,14 +667,6 @@ pub mod duplicates {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PaymentError> for sdk_common::prelude::LnUrlPayError {
|
||||
fn from(value: PaymentError) -> Self {
|
||||
Self::Generic {
|
||||
err: format!("{value}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum LnUrlWithdrawError {
|
||||
/// This error is raised when a general error occurs not specific to other error variants
|
||||
@@ -730,14 +720,6 @@ pub mod duplicates {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PaymentError> for sdk_common::prelude::LnUrlWithdrawError {
|
||||
fn from(value: PaymentError) -> Self {
|
||||
Self::Generic {
|
||||
err: format!("{value}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize)]
|
||||
pub enum LnUrlWithdrawResult {
|
||||
Ok { data: LnUrlWithdrawSuccessData },
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use anyhow::Error;
|
||||
use lwk_wollet::secp256k1;
|
||||
use sdk_common::prelude::LnUrlAuthError;
|
||||
use sdk_common::prelude::{LnUrlAuthError, LnUrlPayError, LnUrlWithdrawError};
|
||||
|
||||
pub type SdkResult<T, E = SdkError> = Result<T, E>;
|
||||
|
||||
@@ -249,9 +249,25 @@ impl From<secp256k1::Error> for PaymentError {
|
||||
}
|
||||
|
||||
impl From<PaymentError> for LnUrlAuthError {
|
||||
fn from(value: PaymentError) -> Self {
|
||||
fn from(err: PaymentError) -> Self {
|
||||
Self::Generic {
|
||||
err: format!("Failed to perform LNURL-auth: {value:?}"),
|
||||
err: err.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PaymentError> for LnUrlPayError {
|
||||
fn from(err: PaymentError) -> Self {
|
||||
Self::Generic {
|
||||
err: err.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<PaymentError> for LnUrlWithdrawError {
|
||||
fn from(err: PaymentError) -> Self {
|
||||
Self::Generic {
|
||||
err: err.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart' hide protected;
|
||||
part 'duplicates.freezed.dart';
|
||||
|
||||
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `clone`, `clone`, `clone`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`, `from`, `from`, `from`, `from`, `from`
|
||||
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `clone`, `clone`, `clone`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `fmt`, `from`, `from`, `from`, `from`, `from`, `from`
|
||||
|
||||
@freezed
|
||||
sealed class LnUrlAuthError with _$LnUrlAuthError implements FrbException {
|
||||
|
||||
@@ -51,7 +51,7 @@ android {
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 24
|
||||
minSdkVersion 33
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ android {
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 24
|
||||
minSdkVersion 33
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
|
||||
android {
|
||||
compileSdkVersion 34
|
||||
defaultConfig {
|
||||
minSdkVersion 24
|
||||
minSdkVersion 33
|
||||
targetSdkVersion 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
buildscript {
|
||||
ext {
|
||||
buildToolsVersion = "33.0.0"
|
||||
minSdkVersion = 24
|
||||
minSdkVersion = 33
|
||||
compileSdkVersion = 34
|
||||
targetSdkVersion = 34
|
||||
kotlin_version = "1.8.0"
|
||||
|
||||
Reference in New Issue
Block a user