#build #version #gitversion

build gitversion_build

Build crate with versions by gitversion

3 releases

0.1.3 Aug 30, 2024
0.1.2 Aug 13, 2024
0.1.1 Jul 10, 2024
0.1.0 Jul 9, 2024

#263 in Build Utils

Download history 106/week @ 2024-08-09 18/week @ 2024-08-16 184/week @ 2024-08-30 8/week @ 2024-09-06 12/week @ 2024-09-13 10/week @ 2024-09-20 12/week @ 2024-09-27 6/week @ 2024-10-04 2/week @ 2024-10-11 1/week @ 2024-10-18

242 downloads per month

MIT license

6KB
78 lines

gitversion_build_rs

Build crate with versions by gitversion

usage

Install gitversion cli first.

Add gitversion_build as build-dependencies

cargo add gitversion_build --build

Add the code to your build.rs

gitversion_build::inject_version().unwrap();

Then you can get CARGO_PKG_VERSION CARGO_PKG_VERSION_MAJOR CARGO_PKG_VERSION_MINOR CARGO_PKG_VERSION_PATCH CARGO_PKG_VERSION_PRE by using env! in your code.

A example at example/demo .

Dependencies

~0.7–1.6MB
~35K SLoC