2023-11-11 01:03:30 +00:00
|
|
|
use preserves_schema::compiler::*;
|
|
|
|
|
|
|
|
fn main() -> std::io::Result<()> {
|
|
|
|
let buildroot = std::path::PathBuf::from(std::env::var_os("OUT_DIR").unwrap());
|
|
|
|
|
|
|
|
let mut gen_dir = buildroot.clone();
|
|
|
|
gen_dir.push("src/schemas");
|
|
|
|
|
2024-02-05 22:46:21 +00:00
|
|
|
let mut c = CompilerConfig::new("crate::schemas".to_owned());
|
2023-11-11 01:03:30 +00:00
|
|
|
c.plugins.push(Box::new(syndicate_schema_plugin::PatternPlugin));
|
|
|
|
|
|
|
|
let inputs = expand_inputs(&vec!["protocols/schema-bundle.bin".to_owned()])?;
|
|
|
|
c.load_schemas_and_bundles(&inputs, &vec![])?;
|
2024-02-05 22:46:21 +00:00
|
|
|
compile(&c, &mut CodeCollector::files(gen_dir))
|
2023-11-11 01:03:30 +00:00
|
|
|
}
|