Browse Source

Rerun build only if proto file chaged (#127)

2 years ago
parent
commit
bd025d85cc
1 changed files with 6 additions and 1 deletions
  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(())
 }