Files
foxhunt/services/ml_training_service/build.rs
jgrusewski 9c3d741a08 refactor: restructure repo — crates/, bin/, testing/ layout
Move 17 library crates into crates/, CLI binary into bin/fxt,
consolidate 10 test crates into testing/, split config crate
from deployment config files.

Root directory reduced from 38+ to ~17 directories.
All Cargo.toml paths and build.rs proto refs updated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 11:56:00 +01:00

36 lines
1.4 KiB
Rust

fn main() -> Result<(), Box<dyn std::error::Error>> {
// NOTE: Tonic 0.14+ uses tonic_prost_build instead of tonic_build
let config = tonic_prost_build::configure();
config
.clone()
.build_server(true)
.build_client(true)
.compile_well_known_types(true)
.extern_path(".google.protobuf", "::prost_types")
.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
// Suppress warnings in generated code
.server_mod_attribute(".", "#[allow(unused_qualifications)]")
.client_mod_attribute(".", "#[allow(unused_qualifications)]")
.compile_protos(&["proto/ml_training.proto"], &["proto"])?;
// Compile TLI BacktestingService proto (client only -- for validation pipeline)
config
.build_server(false)
.build_client(true)
.compile_well_known_types(true)
.extern_path(".google.protobuf", "::prost_types")
.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
.server_mod_attribute(".", "#[allow(unused_qualifications)]")
.client_mod_attribute(".", "#[allow(unused_qualifications)]")
.compile_protos(
&["../../bin/fxt/proto/trading.proto"],
&["../../bin/fxt/proto"],
)?;
println!("cargo:rerun-if-changed=proto/ml_training.proto");
println!("cargo:rerun-if-changed=../../bin/fxt/proto/trading.proto");
Ok(())
}