☕️🍝 Generate type-safe bindings for calling Java APIs from Rust.
APACHE-2.0 License
java-spaghetti
Generate type-safe bindings for calling Java APIs from Rust, so you can fearlessly make your humongous Java spaghetti code aglomeration trascend language barriers and occupy an even larger fraction of the universe's space-time.
jni-bindgen
This project originally started out as a fork of jni-bindgen
.
The main difference is the intended usage: jni-bindgen
aims to generate crates with bindings for a whole Java API (such as jni-android-sys
) which
you then use from your crate. java-spaghetti
is instead designed to generate "mini-bindings" tailored to your project, that you can embed within your crate. This has a few advantages:
java.lang.String
.jni-android-sys
uses one Cargo feature per class to avoid compile time bloat, which is no longer allowed on crates.io.The full list of differences are:
Return<T>
for returning Java objects from JNI calls.AsArg
trait to make them more ergonomic (doesn't need stuff like &**foo
or Some(foo)
).super::...
) instead of absolute paths (crate::...
), so it works if you place it in a submodule not at the crate root..rs
file, there's no support for spltting it in one file per class. You can still run the output through form, if you want.Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.