28 lines
678 B
Rust

use std::process::Command;
extern crate prost_build;
fn main() -> Result<(), std::io::Error> {
println!("cargo:rerun-if-changed=../protobuf/items.proto");
println!("cargo:rerun-if-changed=../frontend/src/");
let mut cfg = prost_build::Config::new();
cfg.type_attribute(
".",
"#[derive(rocket_prost_responder_derive::RocketResponder, serde::Serialize, serde::Deserialize)]",
);
cfg.compile_protos(&["../protobuf/items.proto"], &["../protobuf"])?;
Command::new("pnpm")
.arg("run")
.arg("build")
.current_dir("../frontend")
.spawn()
.unwrap()
.wait()
.unwrap();
Ok(())
}