git-latest-commit

Crates.iogit-latest-commit
lib.rsgit-latest-commit
version0.1.3
sourcesrc
created_at2016-10-29 18:28:06.339071
updated_at2016-11-08 04:05:38.722302
descriptionAdd data about the latest git commit for a project at build time, for run-time reporting.
homepagehttps://github.com/ceejbot/git-latest-commit
repositoryhttps://github.com/ceejbot/git-latest-commit
max_upload_size
id7040
size4,249
C J Silverio (ceejbot)

documentation

README

git-latest-commit

Makes a file available to a Rust project at build time containing the latest commit's sha and summary as static vars.

Shamelessly adapted from cstorey/git-build-version.

Invoke this tool in your package build step. In Cargo.toml, add it as a build dep:

[package]
name = "something-gratuitously-mentioning-rust"
build = "build.rs"

[build-dependencies]
git-latest-commit = "0.1.3"

Then, in build.rs at the top level of your project:

extern crate git_latest_commit;

const PACKAGE_TOP_DIR : &'static str = ".";

fn main()
{
    git_latest_commit::write(PACKAGE_TOP_DIR).expect("Exporting git commit info.");
}

License

ISC

Commit count: 11

cargo fmt