@@ -22,43 +22,47 @@ fn main() {
2222 . jni_class_path ( "Java_io_zenoh_jni_JNINative" )
2323 . jni_method_suffix ( "ViaJNI" )
2424 . kotlin_callback_package ( "io.zenoh.jni.callbacks" )
25- . kotlin_callback_dir (
26- "../zenoh-jni-runtime/src/commonMain/kotlin/io/zenoh/jni/callbacks" ,
27- )
28-
25+ . kotlin_callback_dir ( "../zenoh-jni-runtime/src/commonMain/kotlin/io/zenoh/jni/callbacks" )
2926 // ── Opaque handles — `opaque_handle` configures: jlong wire
3027 // (input + output), `Box::into_raw`/`Box::from_raw` lifecycle,
3128 // `instanceof` dispatch class, and the Kotlin parameter-type
3229 // name. The Kotlin `.kt` file is assumed to be hand-maintained
3330 // by default; chain `.with_methods(...)` (auto-generated class
3431 // with promoted instance methods) or `.emit_kotlin_class()`
3532 // (auto-generated shell class) to switch to auto-emission.
36- . opaque_handle ( "Session" , "io.zenoh.jni.JNISession" )
37- . opaque_handle ( "Config" , "io.zenoh.jni.JNIConfig" )
38- . opaque_handle ( "ZKeyExpr<'static>" , "io.zenoh.jni.JNIKeyExpr" )
39- . opaque_handle ( "Publisher<'static>" , "io.zenoh.jni.JNIPublisher" )
40- . with_methods ( [ "put_publisher" , "delete_publisher" ] )
41- . opaque_handle ( "Subscriber<()>" , "io.zenoh.jni.JNISubscriber" )
42- . emit_kotlin_class ( )
43- . opaque_handle ( "Querier<'static>" , "io.zenoh.jni.JNIQuerier" )
44- . opaque_handle ( "Queryable<()>" , "io.zenoh.jni.JNIQueryable" )
45- . emit_kotlin_class ( )
46- . opaque_handle ( "AdvancedSubscriber<()>" , "io.zenoh.jni.JNIAdvancedSubscriber" )
47- . opaque_handle ( "AdvancedPublisher<'static>" , "io.zenoh.jni.JNIAdvancedPublisher" )
48- . opaque_handle ( "MatchingListener" , "io.zenoh.jni.JNIMatchingListener" )
49- . emit_kotlin_class ( )
50- . opaque_handle ( "SampleMissListener" , "io.zenoh.jni.JNISampleMissListener" )
51- . emit_kotlin_class ( )
52-
33+ . opaque_handle ( "Session" , "io.zenoh.jni.JNISession" )
34+ . opaque_handle ( "Config" , "io.zenoh.jni.JNIConfig" )
35+ . opaque_handle ( "ZKeyExpr<'static>" , "io.zenoh.jni.JNIKeyExpr" )
36+ . opaque_handle ( "Publisher<'static>" , "io.zenoh.jni.JNIPublisher" )
37+ . with_methods ( [ "put_publisher" , "delete_publisher" ] )
38+ . opaque_handle ( "Subscriber<()>" , "io.zenoh.jni.JNISubscriber" )
39+ . emit_kotlin_class ( )
40+ . opaque_handle ( "Querier<'static>" , "io.zenoh.jni.JNIQuerier" )
41+ . opaque_handle ( "Queryable<()>" , "io.zenoh.jni.JNIQueryable" )
42+ . emit_kotlin_class ( )
43+ . opaque_handle (
44+ "AdvancedSubscriber<()>" ,
45+ "io.zenoh.jni.JNIAdvancedSubscriber" ,
46+ )
47+ . opaque_handle (
48+ "AdvancedPublisher<'static>" ,
49+ "io.zenoh.jni.JNIAdvancedPublisher" ,
50+ )
51+ . opaque_handle ( "MatchingListener" , "io.zenoh.jni.JNIMatchingListener" )
52+ . emit_kotlin_class ( )
53+ . opaque_handle ( "SampleMissListener" , "io.zenoh.jni.JNISampleMissListener" )
54+ . emit_kotlin_class ( )
5355 // ── jint-encoded enums — sugar over `input_decoder` for the
5456 // common `jint → enum` pattern.
55- . jint_enum ( "CongestionControl" , "crate::utils::decode_congestion_control" )
56- . jint_enum ( "Priority" , "crate::utils::decode_priority" )
57- . jint_enum ( "Reliability" , "crate::utils::decode_reliability" )
58- . jint_enum ( "QueryTarget" , "crate::utils::decode_query_target" )
57+ . jint_enum (
58+ "CongestionControl" ,
59+ "crate::utils::decode_congestion_control" ,
60+ )
61+ . jint_enum ( "Priority" , "crate::utils::decode_priority" )
62+ . jint_enum ( "Reliability" , "crate::utils::decode_reliability" )
63+ . jint_enum ( "QueryTarget" , "crate::utils::decode_query_target" )
5964 . jint_enum ( "ConsolidationMode" , "crate::utils::decode_consolidation" )
60- . jint_enum ( "ReplyKeyExpr" , "crate::utils::decode_reply_key_expr" )
61-
65+ . jint_enum ( "ReplyKeyExpr" , "crate::utils::decode_reply_key_expr" )
6266 // ── Value-shaped custom converters.
6367 . input_decoder (
6468 "Encoding" ,
@@ -85,7 +89,6 @@ fn main() {
8589 "jni::sys::jobject" ,
8690 "crate::zenoh_id::zenoh_ids_to_java_list(env, v)?" ,
8791 )
88-
8992 // ── Manual callback overrides — replaces the auto-generated
9093 // `process_kotlin_*_callback` dispatcher with a hand-written
9194 // one and reroutes the Kotlin FQN.
@@ -103,7 +106,6 @@ fn main() {
103106 "impl Fn() + Send + Sync + 'static" ,
104107 "io.zenoh.jni.callbacks.JNIOnCloseCallback" ,
105108 )
106-
107109 // ── Kotlin type names for value types that have automatic JNI
108110 // converters (data classes, primitive aliases, callback param
109111 // types whose Kotlin form is hand-maintained).
@@ -139,7 +141,10 @@ fn main() {
139141 . kotlin_value_type ( "HistoryConfig" , "io.zenoh.jni.HistoryConfig" )
140142 . kotlin_value_type ( "CacheConfig" , "io.zenoh.jni.CacheConfig" )
141143 . kotlin_value_type ( "RecoveryConfig" , "io.zenoh.jni.RecoveryConfig" )
142- . kotlin_value_type ( "Option<MissDetectionConfig>" , "io.zenoh.jni.MissDetectionConfig" )
144+ . kotlin_value_type (
145+ "Option<MissDetectionConfig>" ,
146+ "io.zenoh.jni.MissDetectionConfig" ,
147+ )
143148 . kotlin_value_type ( "Option<HistoryConfig>" , "io.zenoh.jni.HistoryConfig" )
144149 . kotlin_value_type ( "Option<CacheConfig>" , "io.zenoh.jni.CacheConfig" )
145150 . kotlin_value_type ( "Option<RecoveryConfig>" , "io.zenoh.jni.RecoveryConfig" )
@@ -149,7 +154,6 @@ fn main() {
149154 // compile, so we point them at `kotlin.Any`).
150155 . kotlin_value_type ( "Query" , "kotlin.Any" )
151156 . kotlin_value_type ( "Reply" , "kotlin.Any" )
152-
153157 // ── impl Into<T> source arms.
154158 . into_sources (
155159 "ZKeyExpr<'static>" ,
@@ -165,11 +169,13 @@ fn main() {
165169 let rust_path = registry
166170 . write_rust ( & jni, "zenoh_flat_jni.rs" )
167171 . expect ( "write rust failed" ) ;
168- println ! ( "cargo:warning=Generated bindings at: {}" , rust_path. display( ) ) ;
172+ println ! (
173+ "cargo:warning=Generated bindings at: {}" ,
174+ rust_path. display( )
175+ ) ;
169176
170177 // ── Write Kotlin output ───────────────────────────────────────────
171- let kotlin_root =
172- std:: path:: Path :: new ( "../zenoh-jni-runtime/src/commonMain/kotlin" ) ;
178+ let kotlin_root = std:: path:: Path :: new ( "../zenoh-jni-runtime/src/commonMain/kotlin" ) ;
173179 for path in jni
174180 . write_kotlin ( & registry, kotlin_root)
175181 . expect ( "write kotlin failed" )
0 commit comments