change-detection
A build script that generates code from static inputs has one job: tell Cargo when to run it again. Get it wrong in one direction and builds are stale; get it wrong in the other and every build redoes the work.
What changes for you
- Correct rerun instructions for directories and files, printed
from one call in
build.rs. - Hashing instead of timestamps, so a touched-but-unchanged file does not trigger a rebuild.
- Less code in build scripts that all projects otherwise repeat.
Getting it
cargo add --build change-detectionuse change_detection::ChangeDetection;
fn main() {
ChangeDetection::path("templates").generate();
}