19 releases
0.3.1 | Nov 2, 2021 |
---|---|
0.3.0 | Oct 2, 2021 |
0.2.2-alpha.13 | Oct 2, 2021 |
0.2.2-alpha.6 | Sep 12, 2021 |
0.1.2-alpha.15 | Sep 12, 2021 |
#703 in Build Utils
193 downloads per month
28KB
551 lines
minver_rs
Implementation of https://github.com/adamralph/minver using Rust
How to use
CLI
The CLI binary allows minver to be run as a regular command.
- Install
minver_rs
usingcargo
> cargo install minver_rs
- Run
minver
(Note: Make sure that.cargo\bin
is on yourPATH
)
> minver
1.2.3
Build Util
The build util binary is a tool that can be integrated into your build to automatically update Cargo.toml
with the correct version.
- Install
minver_rs
usingcargo
> cargo install minver_rs
- Set the environment variable
MINVER_UPDATE_VERSION
> export MINVER_UPDATE_VERSION=1
- Run
minver_build_util
(Note: Make sure that.cargo\bin
is on yourPATH
)
> minver_build_util
As a build dependency
minver_rs
can also be used directly in build.rs
.
- Add a build dependency on
minver_rs
[build-dependencies]
minver_rs = "x.y.z"
- (Optional) Update
version
inCargo.toml
to be0.0.0
. While this is not strictly necessary, it helps to make it apparent that the version is handled automatically by minver. - Add a file called
build.rs
to your project root.
use minver_rs::build_utils;
fn main() {
println!("cargo:rerun-if-changed=build.rs");
build_utils::default_build_action();
}
- Set the environment variable
MINVER_UPDATE_VERSION
> export MINVER_UPDATE_VERSION=1
- Build your crate
> cargo build
Dependencies
~18MB
~410K SLoC