oysterpack_built
is used as a build-time dependency to gather information about the cargo build
environment. It serializes the build-time information into Rust-code, which can then be compiled
into the final crate.
From a DevOps perspective, it is critical to know exactly what is deployed.
oysterpack_built
provides the same functionality as built.
Its main purpose is to standardize the integration for OysterPack apps.
Add the following to Cargo.toml:
[package]
build = "build.rs"
[build-dependencies]
oysterpack_built = "0.2"
oysterpack_built
is added as a build dependencybuild.rs
is the name of the cargo build script to use
Include the following in build.rs:
extern crate oysterpack_built;
fn main() {
oysterpack_built::write_built_file();
}
The build script will by default write a file named built.rs into Cargo's output directory.
It can be picked up and compiled via the op_build_mod!()
macro provided by oysterpackbuiltmod.
The op_build_mod!()
will create a public module named build, which will contain the build-time
information. See oysterpackbuiltmod for details.
Take a look at the changelog for a detailed list of all changes.