gitversion-rs 0.2.4

Rust port of GitVersion — calculates semantic versions from Git history. Full feature port with a Ratatui TUI.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Sample `build.rs` for the consuming crate.
//!
//! Reads the version that was stamped into Cargo.toml (and that Cargo therefore
//! exposes as `CARGO_PKG_VERSION`) and forwards it to the compiler as an extra
//! compile-time constant the application can read with `env!("APP_VERSION")`.
//!
//! This file is a documentation sample — it is intentionally NOT named `main.rs`
//! so Cargo does not auto-discover it as an example of the gitversion-rs crate.

fn main() {
    let version = std::env::var("CARGO_PKG_VERSION").unwrap_or_default();
    println!("cargo:rustc-env=APP_VERSION={version}");
}