3 A small tool to help you generate version information
4 for packages installed from a git repo
8 Add a `build.rs` file to your repo and list it in `Cargo.toml`
13 List rustc_tools_util as regular AND build dependency.
16 rustc_tools_util = "0.3.0"
19 rustc_tools_util = "0.3.0"
22 In `build.rs`, generate the data in your `main()`
26 rustc_tools_util::setup_version_info!();
30 Use the version information in your main.rs
34 let version_info = rustc_tools_util::get_version_info!();
35 println!("{}", version_info);
39 This gives the following output in clippy:
40 `clippy 0.1.66 (a28f3c8 2022-11-20)`
44 This project is part of the rust-lang/rust-clippy repository. The source code
45 can be found under `./rustc_tools_util/`.
47 The changelog for `rustc_tools_util` is available under:
48 [`rustc_tools_util/CHANGELOG.md`](https://github.com/rust-lang/rust-clippy/blob/master/rustc_tools_util/CHANGELOG.md)
52 Copyright 2014-2022 The Rust Project Developers
54 Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
55 http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
56 <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
57 option. All files in the project carrying such notice may not be
58 copied, modified, or distributed except according to those terms.