Skip to content

Add Kotlin JVM bindings#1797

Merged
thesimplekid merged 4 commits into
cashubtc:mainfrom
crodas:feature/binding-kotlin
Apr 2, 2026
Merged

Add Kotlin JVM bindings#1797
thesimplekid merged 4 commits into
cashubtc:mainfrom
crodas:feature/binding-kotlin

Conversation

@crodas
Copy link
Copy Markdown
Collaborator

@crodas crodas commented Mar 30, 2026

Description

Add Kotlin/JVM bindings for CDK using UniFFI, following the same pattern as the existing Dart and Swift bindings. Includes a Gradle project with JNA-based native library loading, a generate-bindings.sh build script, and JUnit 5 integration tests (initial balance, mint flow) mirroring the Dart test suite.


Notes to the reviewers


Suggested CHANGELOG Updates

CHANGED

ADDED

REMOVED

FIXED


Checklist

@crodas crodas requested a review from thesimplekid March 30, 2026 13:32
@crodas crodas self-assigned this Mar 30, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in CDK Mar 30, 2026
@crodas crodas force-pushed the feature/binding-kotlin branch from 970ceea to 3b3123d Compare March 30, 2026 13:44
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.56%. Comparing base (a46f998) to head (6357afb).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1797      +/-   ##
==========================================
+ Coverage   62.51%   62.56%   +0.04%     
==========================================
  Files         329      329              
  Lines       53644    53644              
==========================================
+ Hits        33535    33560      +25     
+ Misses      20109    20084      -25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@crodas crodas force-pushed the feature/binding-kotlin branch 2 times, most recently from 0f8af0c to f9e9944 Compare March 30, 2026 15:19
@crodas crodas moved this from Backlog to In progress in CDK Mar 30, 2026
@crodas crodas marked this pull request as ready for review March 30, 2026 18:43
Copy link
Copy Markdown
Collaborator

@thesimplekid thesimplekid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are things done here that I left on comments on the Dart/Swift PR that I would like to address there before moving on. Multiple rust-toolchains, use of nix develop and not nix build.

#1706

@thesimplekid thesimplekid added this to the 0.17.0 milestone Mar 31, 2026
crodas added 3 commits March 31, 2026 13:49
Add Kotlin/JVM bindings for CDK using UniFFI, following the same pattern as the
existing Dart and Swift bindings. Includes a Gradle project with JNA-based
native library loading, a generate-bindings.sh build script, and JUnit 5
integration tests (initial balance, mint flow) mirroring the Dart test suite.
Add missing rust-toolchain.toml to Kotlin bindings and update Dart and Swift
toolchain pins from 1.90.0 to 1.94.0 to match the workspace.
Move Dart and Kotlin binding generation from shell scripts run inside nix
develop to proper Crane derivations (dartBindings, kotlinBindings) that benefit
from Cachix caching. The expensive Rust cdylib compilation and uniffi-bindgen
codegen are now cached as nix store artifacts, making CI rebuilds near-instant
on cache hit.

Update CI workflow to use `nix build .#dart-bindings` and `nix build
.#kotlin-bindings` instead of `nix develop --command just binding-*`. Outputs
are copied to the expected directory layout so existing test commands continue
to work unchanged.
@crodas crodas force-pushed the feature/binding-kotlin branch 5 times, most recently from 0a508fa to 7559467 Compare March 31, 2026 21:09
@crodas crodas mentioned this pull request Apr 1, 2026
2 tasks
Comment thread bindings/kotlin/.gitignore Outdated
Comment thread bindings/kotlin/generate-bindings.sh Outdated
Comment thread .github/workflows/ci.yml
Comment thread bindings/dart/rust/rust-toolchain.toml Outdated
The three per-binding rust-toolchain.toml files were identical copies
of the root one with cross-compilation targets added. Merge the targets
into the root file and replace the duplicates with symlinks, since
native_toolchain_rust (Dart) expects the file in the crate directory.
@crodas crodas force-pushed the feature/binding-kotlin branch from 7559467 to 6357afb Compare April 1, 2026 15:34
Comment thread justfile
Comment thread .github/workflows/ci.yml
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this different then the one we're already using for our bindings.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we gitignore this?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like its also committed in cdk-kotlin so maybe we need it.

@thesimplekid thesimplekid merged commit 0c83889 into cashubtc:main Apr 2, 2026
180 of 184 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in CDK Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants