2024-02-05 09:28:56 +00:00
|
|
|
use std::path::Path;
|
|
|
|
use std::env;
|
|
|
|
|
|
|
|
fn main() {
|
2024-02-05 14:28:45 +00:00
|
|
|
env::set_var("RUST_LOG", "DEBUG");
|
|
|
|
|
2024-02-05 09:28:56 +00:00
|
|
|
let source_folder = "/mnt/extramedia3/mbess/workspace/popequer/android_app/rust-adapter/src"; //use your projects folder
|
|
|
|
let out_file = "/mnt/extramedia3/mbess/workspace/popequer/android_app/rust-adapter/glue.rs";
|
|
|
|
rifgen::Generator::new(rifgen::TypeCases::CamelCase, rifgen::Language::Java,source_folder)
|
|
|
|
.generate_interface(out_file);
|
|
|
|
|
|
|
|
let swig_gen = flapigen::Generator::new(flapigen::LanguageConfig::JavaConfig(
|
|
|
|
flapigen::JavaConfig::new(
|
|
|
|
Path::new("../app")
|
|
|
|
.join("src")
|
|
|
|
.join("main")
|
|
|
|
.join("java")
|
|
|
|
.join("net")
|
|
|
|
.join("mbess")
|
|
|
|
.join("popequer"),
|
|
|
|
"net.mbess.popequer".into(),
|
|
|
|
)
|
2024-02-05 14:28:45 +00:00
|
|
|
.use_null_annotation_from_package("androidx.annotation".into()),
|
2024-02-05 09:28:56 +00:00
|
|
|
))
|
|
|
|
.rustfmt_bindings(true);
|
|
|
|
|
|
|
|
let out_dir = env::var("OUT_DIR").unwrap();
|
|
|
|
let in_src = Path::new("./").join("glue.rs");
|
|
|
|
let out_src = Path::new(&out_dir).join("java_glue.rs");
|
|
|
|
swig_gen.expand("android bindings", &in_src, &out_src);
|
|
|
|
}
|