1mod sync;
22
23use std::path::Path;
24use sync::Sync;
25
26pub struct Builder {
27 table: Vec<Sync>,
28}
29
30impl Builder {
31 pub fn new() -> Self {
32 Builder { table: Vec::new() }
33 }
34
35 pub fn add<P: AsRef<Path>>(mut self, file: P, dep_file: P) -> Self {
36 println!("cargo:rerun-if-changed={}", dep_file.as_ref().display());
37 self.table.push(Sync::new(
38 file.as_ref().to_path_buf(),
39 dep_file.as_ref().to_path_buf(),
40 ));
41 self
42 }
43
44 pub fn sync(&mut self) {
45 println!("Start syncing code ... {}", self.table.len());
46 for sync in &self.table {
47 sync.sync();
48 }
49 }
50}