8 releases

0.4.2 Feb 14, 2025
0.4.1 Feb 13, 2025
0.4.0 Oct 7, 2024
0.3.0 Dec 15, 2022
0.1.1 Jan 3, 2019

#45 in Build Utils

Download history 10981/week @ 2024-12-20 40782/week @ 2024-12-27 13288/week @ 2025-01-03 20483/week @ 2025-01-10 17623/week @ 2025-01-17 34460/week @ 2025-01-24 25208/week @ 2025-01-31 19614/week @ 2025-02-07 15742/week @ 2025-02-14 29261/week @ 2025-02-21 33210/week @ 2025-02-28 20732/week @ 2025-03-07 18618/week @ 2025-03-14 21979/week @ 2025-03-21 41404/week @ 2025-03-28 19488/week @ 2025-04-04

104,896 downloads per month
Used in 17 crates (9 directly)

MIT/Apache

10KB
169 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.2"

[build-dependencies]
rustc_tools_util = "0.4.2"

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