cargo-plugin, a tool to handle plugins at compile tome for your crate

Warning: experimental project, things might change soon

This tool helps you build a plugin infrastructure for your Rust project. Highlights of that system:

The rust-plugin-test project is an example of this usage.

Installation

Launch the following command:

cargo install cargo-plugin

How to use

Setting it up

This will work better if your project uses a workspace:

You can now publish your crates, first the plugin API, then the plugins crate, then the main one.

Usage

Your crates are published with a default set of plugins. If you want to build a version with a different set of plugins, add and remove plugin folders in plugins/src, then run cargo plugin while in plugins/.

The cargo-plugin tool will read the metadata from every plugin folder, then edit the Cargo.toml and src/lib.rs to do the following tasks: