6 releases (3 breaking)

0.4.0 Oct 7, 2024
0.3.0 Dec 15, 2022
0.2.1 Oct 1, 2022
0.2.0 May 23, 2019
0.1.1 Jan 3, 2019

#101 in Development tools

Download history 24189/week @ 2024-07-23 24340/week @ 2024-07-30 22970/week @ 2024-08-06 15667/week @ 2024-08-13 12714/week @ 2024-08-20 15396/week @ 2024-08-27 20027/week @ 2024-09-03 20914/week @ 2024-09-10 19917/week @ 2024-09-17 22600/week @ 2024-09-24 11550/week @ 2024-10-01 15254/week @ 2024-10-08 25284/week @ 2024-10-15 14939/week @ 2024-10-22 30644/week @ 2024-10-29 8945/week @ 2024-11-05

82,351 downloads per month
Used in 14 crates (7 directly)

MIT/Apache

10KB
160 lines

rustc_tools_util

A small tool to help you generate version information for packages installed from a git repo

Usage

Add a build.rs file to your repo and list it in Cargo.toml

build = "build.rs"

List rustc_tools_util as regular AND build dependency.

[dependencies]
rustc_tools_util = "0.4.0"

[build-dependencies]
rustc_tools_util = "0.4.0"

In build.rs, generate the data in your main()

fn main() {
    rustc_tools_util::setup_version_info!();
}

Use the version information in your main.rs

fn show_version() {
    let version_info = rustc_tools_util::get_version_info!();
    println!("{}", version_info);
}

This gives the following output in clippy: clippy 0.1.66 (a28f3c8 2022-11-20)

Repository

This project is part of the rust-lang/rust-clippy repository. The source code can be found under ./rustc_tools_util/.

The changelog for rustc_tools_util is available under: rustc_tools_util/CHANGELOG.md

License

Copyright 2014-2024 The Rust Project Developers

Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. All files in the project carrying such notice may not be copied, modified, or distributed except according to those terms.

No runtime deps