5 unstable releases

0.3.0 Dec 15, 2022
0.2.1 Oct 1, 2022
0.2.0 May 23, 2019
0.1.1 Jan 3, 2019
0.1.0 Jan 1, 2019

#1042 in Development tools

Download history 9896/week @ 2023-10-20 8586/week @ 2023-10-27 8737/week @ 2023-11-03 8604/week @ 2023-11-10 10344/week @ 2023-11-17 10236/week @ 2023-11-24 9707/week @ 2023-12-01 9965/week @ 2023-12-08 10098/week @ 2023-12-15 8060/week @ 2023-12-22 7554/week @ 2023-12-29 9532/week @ 2024-01-05 9291/week @ 2024-01-12 9291/week @ 2024-01-19 8135/week @ 2024-01-26 7369/week @ 2024-02-02

35,445 downloads per month
Used in 8 crates (7 directly)

MIT/Apache

9KB
151 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.3.0"

[build-dependencies]
rustc_tools_util = "0.3.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-2022 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

Features