Zbobr fix 72 make zenoh kotlin depend on zenoh jni runtime#651
Merged
milyin merged 17 commits intoeclipse-zenoh:external-jnifrom Apr 19, 2026
Conversation
…n-zenoh-jni-runtime
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t wiring - Remove :zenoh-jni from settings.gradle.kts, add gated composite build for zenoh-java submodule - Remove rust-android-gradle plugin from root build.gradle.kts - Rewrite zenoh-kotlin/build.gradle.kts: add zenoh-jni-runtime dependency, add jvmAndAndroidMain source set, remove all Cargo/NDK task wiring Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Kotlin reflection (typeOf<T>()) is not available on Kotlin/Native or Kotlin/JS. Moving these functions to jvmAndAndroidMain mirrors the intentional design in zenoh-jni-runtime where JNIZBytesKotlin is also in jvmAndAndroidMain. Update call sites to use runtime's JNIZBytesKotlin instead of the deleted local JNIZBytes adapter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…classes Delete all JNI adapter files (except JNILiveliness.kt which will be adapted to use runtime's public JNISession methods): - All callbacks in jni/callbacks/ - JNISession, JNIPublisher, JNISubscriber, JNIQuerier, etc. - JNIZBytes (replaced by runtime's JNIZBytesKotlin) Delete duplicate classes that conflict with zenoh-jni-runtime: - exceptions/ZError.kt (runtime provides io.zenoh.exceptions.ZError) - jvmMain/Target.kt (runtime provides io.zenoh.Target) - jvmMain/Zenoh.kt and androidMain/Zenoh.kt (actual ZenohLoad impls, runtime provides io.zenoh.ZenohLoad) - commonMain/Zenoh.kt expect ZenohLoad declaration will be removed next Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t to runtime API
- Zenoh.kt: remove expect ZenohLoad declaration; adapt scout methods to use
JNIScout.scout(Int, JNIScoutCallback, JNIOnCloseCallback, JNIConfig?)
- Config.kt: loadDefault/loadFromFile/loadFromJson/loadFromYaml replace old
methods; wrap runtime calls in runCatching where needed
- KeyExpr.kt: tryFrom/autocanonize now return String from runtime, wrap in
runCatching { KeyExpr(...) }; intersects/includes/relationTo/join/concat
updated to pass JNIKeyExpr? primitives explicitly
- ZenohId.kt: toStringViaJNI → toString (runtime method)
- Logger.kt: replace private external fun with JNILogger.startLogs(filter)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All JNI functionality is now provided by zenoh-jni-runtime from the zenoh-java submodule. The local Rust crate is no longer needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The examples no longer need to build a local Rust JNI library since zenoh-jni-runtime is now the JNI provider via Maven dependency. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- ci.yml: add submodules: recursive checkout, remove cargo fmt/clippy/build steps - publish-jvm.yml: remove 6-platform cross-compilation matrix, simplify to single publish job that depends on zenoh-jni-runtime via Maven - publish-android.yml: remove NDK setup, Rust cross-compilation for Android ABIs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix ntpValue property access to ntpValue() function call in Query.kt - Reorder ReplyKeyExpr enum so MATCHING_QUERY=0, ANY=1 to match Rust mapping - Fix Session.undeclare(KeyExpr) to null out jniKeyExpr after undeclaring and return failure when already undeclared (prevents double-free SIGABRT) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The zenoh-jni Rust crate was deleted; update the release automation script to stop editing the now-nonexistent Cargo.toml and update README to reflect that zenoh-kotlin now depends on zenoh-jni-runtime rather than building its own native JNI library. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ion property
- Gate includeBuild("zenoh-java") behind zenoh.useLocalJniRuntime property so
publication resolves against the published Maven artifact, not a local submodule build
- Add zenohJniRuntimeVersion in gradle.properties to independently track the
zenoh-jni-runtime release version, decoupling it from zenoh-kotlin's own version.txt
- Remove submodule checkout and Rust toolchain from publish-jvm and publish-android
workflows; publish path no longer needs them
- Pass -Pzenoh.useLocalJniRuntime=true in ci.yml test step so CI still builds against
the local submodule, and remove now-unnecessary Rust toolchain install step
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Clarify that the default build/test path resolves zenoh-jni-runtime from Maven and requires no Rust toolchain, while the opt-in local submodule path (-Pzenoh.useLocalJniRuntime=true) builds from source and does require one. Fixes the documentation to match the actual opt-in build wiring. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…or params - Query now stores acceptReplies from the JNI callback instead of inferring from selector parameters - resolveQueryable passes ReplyKeyExpr.entries[acceptReplies] to Query constructor - Selector param parsing now uses getOrThrow() so malformed data surfaces as a failure Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
zenoh-kotlin no longer contains any Rust crates (zenoh-jni/ directory was removed as part of the migration to zenoh-jni-runtime). The publish-github job that invoked publish-crates-github@main is now obsolete and would fail at release time. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Update to latest common-jni commit with markdownlint fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The eclipse-zenoh/zenoh-java#466 introduces itnermediate library
zenoh-jni-runtimewhich wraps the Rust binding and can be reused in higher-levelzenoh-javaandzenoh-kotlinAPIsThis update makes
zenoh-kotlindepend on thiezenoh-jni-runtimelibrary.For development the dependency is made through making
zenoh-javagit submodule inzenoh-kotlin. This submodule should be updated after merging the zenoh-java PR