## Usage
Add a `build.rs` file to your repo and list it in `Cargo.toml`
-````
+````toml
build = "build.rs"
````
List rustc_tools_util as regular AND build dependency.
-````
+````toml
[dependencies]
-rustc_tools_util = "0.1"
+rustc_tools_util = "0.2.1"
[build-dependencies]
-rustc_tools_util = "0.1"
+rustc_tools_util = "0.2.1"
````
In `build.rs`, generate the data in your `main()`
"cargo:rustc-env=COMMIT_DATE={}",
rustc_tools_util::get_commit_date().unwrap_or_default()
);
+ println!(
+ "cargo:rustc-env=RUSTC_RELEASE_CHANNEL={}",
+ rustc_tools_util::get_channel().unwrap_or_default()
+ );
}
````
## License
-Copyright 2014-2018 The Rust Project Developers
+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