1
0
Fork 0
nih-plug/nih_plug_xtask
Robbert van der Helm 3be99f4e8e Split up building and bunding for parallel builds
This helps a lot when using the -p option to bundle multiple packages.
2022-03-08 11:50:36 +01:00
..
src Split up building and bunding for parallel builds 2022-03-08 11:50:36 +01:00
Cargo.toml Move the xtask binary to a library 2022-03-02 10:02:03 +01:00
README.md Update the bundler xtask and cargo subcommand docs 2022-03-02 11:19:35 +01:00

NIH-plug: bundler and other utilities

This is NIH-plug's cargo xtask command, but as a library. This way you can use it in your own projects without having to either fork this repo or vendor the binary into your own repo. This is necessary until Cargo supports running binaries from dependencies directly.

To use this, add an xtask binary to your project using cargo new --bin xtask and add it to the Cargo workspace in your repository's main Cargo.toml file:

# Cargo.toml

[workspace]
members = ["xtask"]

Then add nih_plug_xtask to your new xtask package's dependencies:

# xtask/Cargo.toml

[dependencies]
nih_plug_xtask = { git = "https://github.com/robbert-vdh/nih-plug" }

Call nih_plug_xtask's main function own xtask binary:

# xtask/src/main.rs

fn main() -> nih_plug_xtask::Result<()> {
    nih_plug_xtask::main()
}

And finally create a .cargo/config file in your repository and add a Cargo alias so you can invoke the binary with cargo xtask:

# .cargo/config

[alias]
xtask = "run --package xtask --release --"