gitversion_build

Crates.iogitversion_build
lib.rsgitversion_build
version0.1.3
sourcesrc
created_at2024-07-09 15:38:38.976312
updated_at2024-08-30 16:13:09.34246
descriptionBuild crate with versions by gitversion
homepagehttps://github.com/zhangchaoza/gitversion_build_rs
repositoryhttps://github.com/zhangchaoza/gitversion_build_rs
max_upload_size
id1297210
size15,585
zhangchao (zhangchaoza)

documentation

README

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 .

Commit count: 7

cargo fmt