gelx_build 0.6.0

Enable reading from the configuration in the `Cargo.toml` file while using the `gelx` macros
Documentation

gelx_build

By default the gelx macros can't read the configuration from the Cargo.toml file. This crate provides a way to read the configuration from the Cargo.toml file using the build.rs script.

Crate Docs Status Unlicense codecov

Overview

The gelx_build crate provides a way to read the configuration from the Cargo.toml file using the build.rs script.

This crate is only needed if you want to customise the configuration of the gelx macros.

Installation

[build-dependencies]
gelx_build = "0.6"

or via the command line:

cargo add --build gelx_build

Usage

// build.rs

use gelx_build::gelx_build_sync;

fn main() {
	let _ = gelx_build_sync();
}

The above code will read the configuration from the Cargo.toml file and create an environment variable called GELX_METADATA_BASE64 that contains the json configuration. The GELX_METADATA_BASE64 environment variable is then used by the gelx_macros crate to read the configuration and use it when generating code.

If you would like to use the async version, you can use the gelx_build function instead.

// build.rs

use gelx_build::gelx_build;
use gelx_build::tokio;

#[tokio::main]
async fn main() {
	let _ = gelx_build().await;
}

Contributing

This crate is part of the gelx workspace. Please refer to the main project's contributing guide for details on how to set up the development environment and contribute.

License

Unlicense, see the license file in the root of the workspace.