Skip to main content

alef_backend_kotlin/
lib.rs

1//! Kotlin (JVM) binding generator backend for alef.
2//!
3//! Phase 1A skeleton: registers `KotlinBackend` and exposes `BuildConfig`
4//! with `BuildDependency::Ffi`. Kotlin/JVM consumes the same Java/Panama
5//! `.so` produced by the Java backend; real codegen lands in Phase 1B.
6//! Kotlin/Native and Kotlin Multiplatform paths are deferred to Phase 3.
7
8mod gen_bindings;
9mod gen_mpp;
10pub(crate) mod gen_native;
11pub mod naming;
12mod template_env;
13mod type_map;
14
15pub use gen_bindings::KotlinBackend;
16pub use gen_bindings::trait_bridge::KotlinJvmBridgeGenerator;
17
18// Re-exports used by the sibling `alef-backend-kotlin-android` crate so it can
19// emit the same Kotlin/JVM-flavoured glue code for AAR consumers without
20// duplicating the helpers.
21pub use gen_bindings::{
22    emit_enum_pub, emit_error_type_pub, emit_function_jvm, emit_jvm_client_class, emit_jvm_client_class_with_package,
23    emit_kdoc_pub, emit_type_pub, emit_type_pub_with_defaults_sealed_and_constructible,
24    emit_type_pub_with_enum_defaults, emit_type_pub_with_enum_defaults_and_sealed_classes, kotlin_type_str_pub,
25    to_lower_camel, to_pascal_case,
26};
27
28// JNI emission helpers re-exported for the kotlin-android backend.
29pub use gen_bindings::jni_emitter::{emit_jni_bridge_object, emit_jni_client_class, emit_streaming_jni_external_funs};
30
31// Literal normalizer re-exported for the kotlin-android backend.
32pub use gen_bindings::literal_normalizer;