Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .swiftformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--swiftversion 5.5
--indent 4
--disable blankLineAfterImports
--disable redundantReturn
--disable opaqueGenericParameters
--binary-grouping none
--decimal-grouping none
--hex-grouping none
--octal-grouping none
--semicolons never
--wrapparameters before-first

6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Unreleased
# 0.7.0-rc.65 (Synonym Fork)

- The Android AAR now ships targeted R8 consumer keep rules for the UniFFI/JNA FFI surface.
## Bug Fixes

- Add keep consumer rules for JNA types UniFFI needs under R8.

# 0.7.0-rc.64 (Synonym Fork)

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exclude = ["bindings/uniffi-bindgen"]

[package]
name = "ldk-node"
version = "0.7.0-rc.64"
version = "0.7.0-rc.65"
authors = ["Elias Rohrer <dev@tnull.de>"]
homepage = "https://lightningdevkit.org/"
license = "MIT OR Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import PackageDescription

let tag = "v0.7.0-rc.64"
let checksum = "8890d1b91f2b3e0a33ffd2854e1a4e9721e99706e8378177d30fbc435cd2db49"
let tag = "v0.7.0-rc.65"
let checksum = "c9e1b4fd124434a955f75a41044f5d3f2efbd14b1bb49276cc64bc174a43daee"
let url = "https://github.com/synonymdev/ldk-node/releases/download/\(tag)/LDKNodeFFI.xcframework.zip"

let package = Package(
Expand Down
6 changes: 1 addition & 5 deletions bindgen.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail

# Install gobley-uniffi-bindgen once for all Kotlin scripts
echo "Installing gobley-uniffi-bindgen fork..."
cargo install --git https://github.com/ovitrif/gobley.git \
--branch fix-v0.2.0 gobley-uniffi-bindgen --force
export BINDGEN_GOBLEY_INSTALLED=1
source ./scripts/install_gobley_bindgen.sh

# Standardize on release-smaller for all targets
export BINDGEN_PROFILE="release-smaller"
Expand Down
2 changes: 1 addition & 1 deletion bindings/kotlin/ldk-node-android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official
group=com.synonym
version=0.7.0-rc.64
version=0.7.0-rc.65
24 changes: 20 additions & 4 deletions bindings/kotlin/ldk-node-android/lib/consumer-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,29 @@
<methods>;
}

# UniFFI 0.28 loads UniffiLib via Native.load; JNA looks up interface methods by name.
-keep,includedescriptorclasses interface org.lightningdevkit.ldknode.UniffiLib {
<methods>;
# Native.register maps remaining native methods by exact C symbol name.
-keepclasseswithmembers,allowshrinking,includedescriptorclasses class org.lightningdevkit.ldknode.UniffiLib {
native <methods>;
}
-keepclasseswithmembers,allowshrinking,includedescriptorclasses class org.lightningdevkit.ldknode.IntegrityCheckingUniffiLib {
native <methods>;
}

# @Structure.FieldOrder is read at runtime.
# JNA reads Structure.FieldOrder at runtime. R8 full mode strips that
# annotation unless the annotation type and annotated classes are kept.
-keepattributes RuntimeVisibleAnnotations
-keep,allowshrinking,allowoptimization class com.sun.jna.Structure$FieldOrder
-keep,allowshrinking,allowoptimization,allowobfuscation @com.sun.jna.Structure$FieldOrder class org.lightningdevkit.ldknode.** {
<fields>;
<init>(...);
}

# libjnidispatch looks up Native/Structure/CallbackReference members by JNI name.
# Subclasses such as com.sun.jna.ptr.IntByReference are kept by the extends rules.
# See https://github.com/java-native-access/jna/blob/master/www/FrequentlyAskedQuestions.md#jna-on-android
-keep class com.sun.jna.* { *; }
-keep class * extends com.sun.jna.* { *; }
-keepclassmembers class * extends com.sun.jna.* { public *; }

# JNA's AAR references desktop AWT types that are absent on Android.
-dontwarn java.awt.Component
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion bindings/kotlin/ldk-node-jvm/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx1536m
kotlin.code.style=official
group=com.synonym
version=0.7.0-rc.64
version=0.7.0-rc.65
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ldk_node"
version = "0.7.0-rc.64"
version = "0.7.0-rc.65"
authors = [
{ name="Elias Rohrer", email="dev@tnull.de" },
]
Expand Down
15 changes: 15 additions & 0 deletions scripts/install_gobley_bindgen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Pin gobley-uniffi-bindgen under target/ so other repos cannot overwrite ~/.cargo/bin.

GOBLEY_REV="36730a4219b2e8d06aa2c073936d6fc6a7f60e0f"
GOBLEY_ROOT="${PWD}/target/gobley-bindgen"
STAMP="${GOBLEY_ROOT}/rev"

if [ ! -x "${GOBLEY_ROOT}/bin/gobley-uniffi-bindgen" ] || [ "$(cat "${STAMP}" 2>/dev/null || true)" != "${GOBLEY_REV}" ]; then
echo "Installing gobley-uniffi-bindgen ${GOBLEY_REV} into ${GOBLEY_ROOT}..."
cargo install --git https://github.com/ovitrif/gobley.git --rev "${GOBLEY_REV}" --root "${GOBLEY_ROOT}" gobley-uniffi-bindgen --force
echo "${GOBLEY_REV}" > "${STAMP}"
fi

export PATH="${GOBLEY_ROOT}/bin:${PATH}"
export BINDGEN_GOBLEY_INSTALLED=1
6 changes: 1 addition & 5 deletions scripts/uniffi_bindgen_generate_kotlin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ TARGET_DIR="target"
PROJECT_DIR="ldk-node-jvm"
JVM_LIB_DIR="$BINDINGS_DIR/$PROJECT_DIR"

# Install gobley-uniffi-bindgen from fork (skip if orchestrator already installed it)
if [ -z "${BINDGEN_GOBLEY_INSTALLED:-}" ]; then
echo "Installing gobley-uniffi-bindgen fork..."
cargo install --git https://github.com/ovitrif/gobley.git --branch fix-v0.2.0 gobley-uniffi-bindgen --force
fi
source "$(dirname "${BASH_SOURCE[0]}")/install_gobley_bindgen.sh"
UNIFFI_BINDGEN_BIN="gobley-uniffi-bindgen"

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
Expand Down
Loading