| Crates.io | cargo-consolidate |
| lib.rs | cargo-consolidate |
| version | 0.1.0 |
| created_at | 2024-11-01 14:37:07.829628+00 |
| updated_at | 2024-11-01 14:37:07.829628+00 |
| description | A command-line tool to consolidate dependencies in a Rust workspace. |
| homepage | https://github.com/gruberb/cargo-consolidate |
| repository | https://github.com/gruberb/cargo-consolidate |
| max_upload_size | |
| id | 1431877 |
| size | 59,362 |
The cargo-consolidate is a CLI to easier manage workspace dependencies. It scans all workspace members and checks, depending on the arguments passed, if a dependency is shared across at least two members. If so, it moves it up to the workspace Cargo.toml file.
Warning: There is no path resolution yet. So you most probably have to double check manually.
This is very much a WIP and a first shot in saving a 30 minutes of trying to manually combine workspace dependencies.
> cargo-consolidate --help
Usage: cargo-consolidate [OPTIONS]
Options:
--manifest-path <MANIFEST_PATH> Path to the workspace root Cargo.toml of the project you want to consolidate
--group-all Group dependencies of all members into workspace.dependencies If set to false, just dependencies which are used by 2 or more members are being grouped into workspace.dependencies
-v, --verbose... Increase output verbosity (can be used multiple times)
-h, --help Print help
You can install cargo-consolidate directly from crates.io:
cargo install cargo-consolidate
cargo-consolidate --manifest-path /path/to/your/workspace/Cargo.toml
By default, a dependency has to occour at least twice to move it up to the project Cargo.toml. If you want to move EVERY dependency up, use the --group-all flag:
cargo-consolidate --manifest-path /path/to/your/workspace/Cargo.toml --group-all