Skip to content

feat(android): add yrs-android AAR (JNI binding to the yrs CRDT core)#1

Merged
brian-contio-ai merged 1 commit into
mainfrom
android-aar
Jun 12, 2026
Merged

feat(android): add yrs-android AAR (JNI binding to the yrs CRDT core)#1
brian-contio-ai merged 1 commit into
mainfrom
android-aar

Conversation

@brian-contio-ai

@brian-contio-ai brian-contio-ai commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

What

Adds an Android sibling to the committed Apple YrsFFI.xcframework: a thin Gradle android-library (android/) that exposes the same yrs 0.25.x Rust core to Kotlin via a JNI shim, packaged as an AAR with the per-ABI libyrs_android.so committed (consumers need no Rust — exactly like the xcframework).

Consumption (no release pipeline)

Served from GitHub via JitPack — verified building on this branch:

repositories { maven("https://jitpack.io") }
implementation("com.github.Contio-AI:YrsFFI:0.25.1")

The Gradle analog of how SwiftPM consumes the xcframework by git URL. The branch build produced a valid AAR (ai.contio.yrs.YrsNative + 4 jni/<abi>/libyrs_android.so).

Layout

  • android/rust/ — JNI shim crate (binds yrs directly; one fewer FFI hop than the C ABI).
  • android/yrs-android/ — android-library; committed .so under src/main/jniLibs; maven-publish for JitPack.
  • scripts/build-aar.sh — maintainer cargo-ndk rebuild (pins ~/.cargo/bin so a non-rustup cargo doesn't shadow the Android targets).
  • jitpack.yml — builds only the android/ Gradle project.
  • YrsNative (pkg ai.contio.yrs) is the raw JNI boundary; idiomatic YDoc/YText wrappers live downstream, mirroring the Apple side.

README updated to document both platforms.

After merge: tag 0.25.1 (additive Android slice, no upstream change).

Android sibling of the committed Apple xcframework: a thin Gradle android-library
that exposes the same yrs Rust core to Kotlin via a JNI shim, packaged as an AAR
with the per-ABI libyrs_android.so committed (consumers need no Rust, exactly like
the xcframework). Maintainers regenerate the .so with scripts/build-aar.sh (cargo-ndk).

Consumed from GitHub via JitPack:
  repositories { maven("https://jitpack.io") }
  implementation("com.github.Contio-AI:YrsFFI:0.25.1")

YrsNative (package ai.contio.yrs) is the raw JNI boundary; idiomatic YDoc/YText
wrappers live downstream, mirroring the Apple side. README updated for both platforms.
@brian-contio-ai brian-contio-ai changed the title feat(android): add yrs-android AAR (JNI binding to yrs CRDT, JitPack-served) feat(android): add yrs-android AAR (JNI binding to the yrs CRDT core) Jun 12, 2026
@brian-contio-ai brian-contio-ai merged commit 5a2f87d into main Jun 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant