fn main() { codegen::serde_integration(); } mod codegen { extern crate syntex; extern crate serde_codegen; use std::env; use std::path::Path; use std::fs::create_dir_all; pub fn serde_integration() { let out_dir = env::var_os("OUT_DIR").unwrap(); let todo = vec![("model", "graphml.rs")]; for &(folder, file) in todo.iter() { let input = format!("src/{}/{}.in", folder, file); let src = Path::new(&input); let dst = Path::new(&out_dir).join(folder); create_dir_all(&dst).expect("creating output codegen folder"); let dst = dst.join(file); let mut registry = syntex::Registry::new(); serde_codegen::register(&mut registry); registry.expand("", &src, &dst).unwrap(); } } }