Parcourir la source

Rerun build only if proto file chaged (#127)

il y a 2 ans
Parent
commit
bd025d85cc
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 6 1
      data_server/build.rs

+ 6 - 1
data_server/build.rs

@@ -1,4 +1,9 @@
 fn main() -> Result<(), Box<dyn std::error::Error>> {
-    tonic_build::compile_protos("../fish_speech/datasets/protos/text-data.proto")?;
+    const TEXT_DATA_PROTO: &str = "../fish_speech/datasets/protos/text-data.proto";
+
+    println!("cargo::rerun-if-changed=build.rs");
+    println!("cargo::rerun-if-changed={}", TEXT_DATA_PROTO);
+
+    tonic_build::compile_protos(TEXT_DATA_PROTO)?;
     Ok(())
 }