1
0
Fork 0
nih-plug/nih_plug_xtask
Robbert van der Helm 08ddd9c42a For cargo_nih_plug workspace root detection
This is a lot simpler now and it simply considers the topmost ancestor
directory of either `$CARGO_MANIFEST_DIR` or the current working
directory containing a `Cargo.toml` file.
2022-11-13 18:33:15 +01:00
..
src For cargo_nih_plug workspace root detection 2022-11-13 18:33:15 +01:00
Cargo.toml Add missing .git suffixes for GitHub VCS deps 2022-05-24 15:24:33 +02:00
README.md Fix typos in nih_plug_xtask's readme 2022-07-03 19:49:20 +02:00

NIH-plug: bundler and other utilities

This is NIH-plug's cargo xtask command, 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. Then add that binary to the Cargo workspace in your repository's main Cargo.toml file like so:

# Cargo.toml

[workspace]
members = ["xtask"]

Add nih_plug_xtask to the new xtask package's dependencies, and call its main function from the new xtask binary:

# xtask/Cargo.toml

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

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

Lastly, create a .cargo/config file in your repository and add a Cargo alias. This allows you to run the binary using cargo xtask:

# .cargo/config

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