Replace glib_build_tools with a diagnostic re-implementation

This commit is contained in:
Savanni D'Gerinel 2024-01-25 12:45:41 -05:00
parent c79324a843
commit 0bd93670ba
1 changed files with 27 additions and 5 deletions

View File

@ -1,7 +1,29 @@
use std::{env, path::Path, process::Command};
fn main() { fn main() {
glib_build_tools::compile_resources::<String>( let source_dirs: Vec<String> = vec!["/build/source".to_owned()];
&[], let gresource = "/build/source/gresources.xml";
"gresources.xml", let target = "com.luminescent-dreams.resources-demo";
"com.luminescent-dreams.resources-demo",
); let out_dir = env::var("OUT_DIR").unwrap();
let out_dir = Path::new(&out_dir);
let mut command = Command::new("glib-compile-resources");
for source_dir in source_dirs {
command.arg("--sourcedir").arg(&source_dir);
}
let cmd = command.arg("--target").arg(out_dir.join(target)).arg(gresource);
eprintln!("[Program ] {}", cmd.get_program().to_string_lossy().to_owned());
for arg in cmd.get_args() {
eprintln!("[arg ] {}", arg.to_string_lossy().to_owned());
}
eprintln!("[current dir] {:?}", cmd.get_current_dir());
let output = cmd.output().unwrap();
for line in String::from_utf8(output.stdout).unwrap().lines() {
eprintln!("{}", line);
}
} }