Expand description

MCAI Build

This crates allows to export Cargo.toml variables at compile time, so that they can be used at execution time.

Usage

  1. Add mcai_build in the build-dependencies of your package.
  2. Add serde_json in the dependencies of your package.
  3. Add a build.rs file next to your Cargo.toml that contains the following code:
fn main() {
  mcai_build::build_mcai_info()
}
  1. You can now use the exported variables in your code:
use cargo_toml::Package;

let package: Package = include!(concat!(env!("OUT_DIR"), "/mcai_build.rs"));

Functions