use std::{fs::File, io::Write}; use std::env; // Build.rs does not use all provided functions #[allow(dead_code)] #[path = "src/git.rs"] mod git; fn main() { let ver = env!("CARGO_PKG_VERSION"); File::create("src/gir_version.rs") .and_then(|mut f| writeln!(f, "pub const VERSION: &str = \"{ver}\";",)) .unwrap(); }