mobile-app/rust-adapter/build.rs

32 lines
1.1 KiB
Rust
Raw Normal View History

use std::path::Path;
use std::env;
fn main() {
2024-02-05 14:28:45 +00:00
env::set_var("RUST_LOG", "DEBUG");
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()),
))
.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);
}