// tauri::generate_context!() embeds `frontendDist` at compile time. Without // rerun directives cargo does NOT rebuild the .so when frontend files change // (observed: stale grid code survived a "successful" rebuild). Directory-level // rerun-if-changed only tracks the dir mtime (add/remove/rename, NOT content // edits), so list every file explicitly. fn walk(p: &std::path::Path) { for e in std::fs::read_dir(p).unwrap() { let e = e.unwrap(); let path = e.path(); if path.is_dir() { walk(&path); } else { println!("cargo:rerun-if-changed={}", path.display()); } } } fn main() { walk(std::path::Path::new("frontend/dist")); println!("cargo:rerun-if-changed=tauri.conf.json"); // tauri_build::build() inspects the TARGET env var itself (build scripts // run on the HOST, so a cfg(target_os) gate would disable it). For // android targets it emits `cargo:rustc-cfg=mobile`, which is what // activates `#[cfg_attr(mobile, tauri::mobile_entry_point)]`. tauri_build::build(); }