mobile-app/rust-adapter/build.rs

30 lines
1.1 KiB
Rust
Raw Normal View History

use std::path::Path;
use std::env;
fn main() {
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(),
)
.use_null_annotation_from_package("android.support.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);
}