diff --git a/Cargo.lock b/Cargo.lock index 7c60b05a..a941ef12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -89,6 +89,13 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" +[[package]] +name = "cargo-nih-plug" +version = "0.1.0" +dependencies = [ + "nih_plug_xtask", +] + [[package]] name = "cc" version = "1.0.73" diff --git a/Cargo.toml b/Cargo.toml index a8642215..5e0573fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,8 @@ members = [ "nih_plug_derive", "nih_plug_egui", "nih_plug_xtask", + + "cargo_nih_plug", "xtask", "plugins/examples/gain", diff --git a/cargo_nih_plug/Cargo.toml b/cargo_nih_plug/Cargo.toml new file mode 100644 index 00000000..bff2ea43 --- /dev/null +++ b/cargo_nih_plug/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "cargo-nih-plug" +version = "0.1.0" +edition = "2021" +authors = ["Robbert van der Helm "] +description = "A cargo subcommand for compiling and bundling plugins, analogous to NIH-plug's `cargo xtask`" +license = "ISC" + +[dependencies] +nih_plug_xtask = { path = "../nih_plug_xtask" } diff --git a/cargo_nih_plug/README.md b/cargo_nih_plug/README.md new file mode 100644 index 00000000..dbd2701f --- /dev/null +++ b/cargo_nih_plug/README.md @@ -0,0 +1,13 @@ +# NIH-plug: cargo subcommand for bundling plugins + +This is NIH-plug's `cargo xtask` command, as a `cargo` subcommand. This way you +can use it outside of NIH-plug projects. If you're using NIH-plug, you'll want +to use the xtask integration directly instead, see: +. + +Since this has not yet been published to `crates.io`, you'll need to install +this using: + +```shell +cargo install --git https://github.com/robbert-vdh/nih-plug.git cargo-nih-plug +``` diff --git a/cargo_nih_plug/src/main.rs b/cargo_nih_plug/src/main.rs new file mode 100644 index 00000000..eb430e6b --- /dev/null +++ b/cargo_nih_plug/src/main.rs @@ -0,0 +1,6 @@ +fn main() -> nih_plug_xtask::Result<()> { + // This includes both the `cargo` command and the `nih-plug` subcommand, so we should get rid of + // those first + let args = std::env::args().skip(2); + nih_plug_xtask::main_with_args(args) +} diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 9f798646..ce253cf9 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -3,6 +3,7 @@ name = "xtask" version = "0.1.0" edition = "2021" authors = ["Robbert van der Helm "] +description = "A helper for compiling and bundling plugins, can be invoked in this repo using `cargo xtask`" license = "ISC" [dependencies]