Skip to content

Commit 61c57d3

Browse files
authored
Merge pull request #16 from synonymdev/feat/android-kotlin-serializable
feat: serializable types in android bindings
2 parents 508f038 + 08fff8c commit 61c57d3

File tree

20 files changed

+15594
-16005
lines changed

20 files changed

+15594
-16005
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ swift.swiftdoc
3030

3131
# fork
3232
!/bindings/kotlin/ldk-node-android/lib/src/main/jniLibs
33-
!/bindings/kotlin/ldk-node-android/lib/src/main/kotlin/org/lightningdevkit/ldknode/ldk_node.kt
3433
.idea
34+
.build
35+
.cursor
36+
.claude
3537
*.local.*
3638
CLAUDE.md

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ldk-node"
3-
version = "0.6.2-rc.3"
3+
version = "0.6.2-rc.4"
44
authors = ["Elias Rohrer <[email protected]>"]
55
homepage = "https://lightningdevkit.org/"
66
license = "MIT OR Apache-2.0"
@@ -85,7 +85,7 @@ esplora-client = { version = "0.12", default-features = false, features = ["toki
8585
esplora-client_0_11 = { package = "esplora-client", version = "0.11", default-features = false, features = ["tokio", "async-https-rustls"] }
8686
electrum-client = { version = "0.24.0", default-features = true }
8787
libc = "0.2"
88-
uniffi = { version = "0.27.3", features = ["build"], optional = true }
88+
uniffi = { version = "0.28.3", features = ["build"], optional = true }
8989
serde = { version = "1.0.210", default-features = false, features = ["std", "derive"] }
9090
serde_json = { version = "1.0.128", default-features = false, features = ["std"] }
9191
log = { version = "0.4.22", default-features = false, features = ["std"]}
@@ -118,7 +118,7 @@ lnd_grpc_rust = { version = "2.10.0", default-features = false }
118118
tokio = { version = "1.37", features = ["fs"] }
119119

120120
[build-dependencies]
121-
uniffi = { version = "0.27.3", features = ["build"], optional = true }
121+
uniffi = { version = "0.28.3", features = ["build"], optional = true }
122122

123123
[profile.release]
124124
panic = "abort"

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import PackageDescription
55

66
let tag = "v0.6.2-rc.3"
7-
let checksum = "ee0ccf65c286d652afc72cc613f7477f1c2c65faaf1774c5a8e21141b64b226b"
7+
let checksum = "2d56ab258b64757ed4aae0986332a97590ad26046a5c0dcc085bd6d6a60779d5"
88
let url = "https://github.com/synonymdev/ldk-node/releases/download/\(tag)/LDKNodeFFI.xcframework.zip"
99

1010
let package = Package(

bindings/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## Generating the Bindings
22

3+
## Build All Bindings
34
Run in the root dir:
45
```sh
56
RUSTFLAGS="--cfg no_download" cargo build && ./scripts/uniffi_bindgen_generate.sh && ./scripts/swift_create_xcframework_archive.sh && sh scripts/uniffi_bindgen_generate_kotlin_android.sh
@@ -11,7 +12,7 @@ Detailed instructions for publishing a new version of the bindings.
1112

1213
1. Update `Cargo.toml`
1314
2. Update `libraryVersion` in `bindings/kotlin/ldk-node-android/gradle.properties`
14-
3. Run the command to generate all bindings
15+
3. Run the above command to build all bindings
1516
4. Open a PR with the changes
1617
5. Create a new GitHub release with a new tag like `v0.1.0`, uploading the following files:
1718
- `bindings/swift/LDKNodeFFI.xcframework.zip`

bindings/kotlin/ldk-node-android/build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ buildscript {
44
mavenCentral()
55
}
66
dependencies {
7-
classpath("com.android.tools.build:gradle:7.1.2")
7+
classpath("com.android.tools.build:gradle:8.1.1")
88
}
99
}
1010

1111
plugins {
12+
kotlin("android") version "1.9.20" apply false
13+
kotlin("plugin.serialization") version "1.9.20" apply false
1214
}
1315

1416
// library version is defined in gradle.properties

bindings/kotlin/ldk-node-android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ org.gradle.jvmargs=-Xmx1536m
22
android.useAndroidX=true
33
android.enableJetifier=true
44
kotlin.code.style=official
5-
libraryVersion=0.6.2-rc.1
5+
libraryVersion=0.6.2-rc.4
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

bindings/kotlin/ldk-node-android/lib/build.gradle.kts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ val libraryVersion: String by project
33

44
plugins {
55
id("com.android.library")
6-
id("org.jetbrains.kotlin.android") version "1.6.10"
6+
kotlin("android")
7+
kotlin("plugin.serialization")
78

89
id("maven-publish")
910
id("signing")
@@ -16,11 +17,11 @@ repositories {
1617
}
1718

1819
android {
20+
namespace = "org.lightningdevkit.ldknode"
1921
compileSdk = 34
2022

2123
defaultConfig {
2224
minSdk = 21
23-
targetSdk = 31
2425
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2526
consumerProguardFiles("consumer-rules.pro")
2627
}
@@ -32,6 +33,15 @@ android {
3233
}
3334
}
3435

36+
compileOptions {
37+
sourceCompatibility = JavaVersion.VERSION_1_8
38+
targetCompatibility = JavaVersion.VERSION_1_8
39+
}
40+
41+
kotlinOptions {
42+
jvmTarget = "1.8"
43+
}
44+
3545
publishing {
3646
singleVariant("release") {
3747
withSourcesJar()
@@ -46,13 +56,9 @@ dependencies {
4656
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
4757
implementation("androidx.appcompat:appcompat:1.4.0")
4858
implementation("androidx.core:core-ktx:1.7.0")
59+
implementation("org.jetbrains.kotlinx:atomicfu:0.23.1")
60+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0")
4961
api("org.slf4j:slf4j-api:1.7.30")
50-
51-
androidTestImplementation("com.github.tony19:logback-android:2.0.0")
52-
androidTestImplementation("androidx.test.ext:junit:1.1.3")
53-
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
54-
androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
55-
androidTestImplementation("org.jetbrains.kotlin:kotlin-test-junit")
5662
}
5763

5864
afterEvaluate {

bindings/kotlin/ldk-node-android/lib/src/androidTest/kotlin/org/lightningdevkit/ldknode/AndroidLibTest.kt

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="org.lightningdevkit">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32

43
<uses-permission android:name="android.permission.INTERNET" />
54

65
</manifest>
7-

0 commit comments

Comments
 (0)