build.rs 417 B

12345678910111213
  1. use anyhow::Result;
  2. use vergen::{vergen, Config, SemverKind};
  3. fn main() -> Result<()> {
  4. let mut config = Config::default();
  5. // Change the SEMVER output to the lightweight variant
  6. *config.git_mut().semver_kind_mut() = SemverKind::Lightweight;
  7. // Add a `-dirty` flag to the SEMVER output
  8. *config.git_mut().semver_dirty_mut() = Some("-dirty");
  9. // Generate the instructions
  10. vergen(config)
  11. }