660855ecd6
Protobuf data model (Template/PrintJob/MaterialProfile/PrintParameters) with codegen targets for TypeBox+TS types (packages/ts-types) and prost-derived Rust structs (packages/rust-types). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
28 lines
892 B
Rust
28 lines
892 B
Rust
use std::path::PathBuf;
|
|
|
|
fn main() {
|
|
let proto_root = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
|
.join("../../proto")
|
|
.canonicalize()
|
|
.expect("proto root must exist");
|
|
|
|
let proto_files = [
|
|
proto_root.join("continuum/v1/material.proto"),
|
|
proto_root.join("continuum/v1/print_params.proto"),
|
|
proto_root.join("continuum/v1/template.proto"),
|
|
proto_root.join("continuum/v1/print_job.proto"),
|
|
];
|
|
|
|
for file in &proto_files {
|
|
println!("cargo:rerun-if-changed={}", file.display());
|
|
}
|
|
|
|
let mut config = prost_build::Config::new();
|
|
config.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]");
|
|
config.type_attribute(".", "#[serde(rename_all = \"camelCase\")]");
|
|
|
|
config
|
|
.compile_protos(&proto_files, &[proto_root])
|
|
.expect("failed to compile continuum .proto sources");
|
|
}
|