Updating dependencies
When you have multiple packages which depend on each other, you’ll likely want to keep those dependencies up to date.
For example, Knope depends on the knope-versioning crate.
Whenever knope-versioning is updated, the new version should appear in:
knope-versioning’sCargo.toml, defining the new version of the packageknope’sCargo.toml, specifying the new version ofknope-versioningas a dependency- The workspace
Cargo.lock, recording the exact version ofknope-versioningused by the workspace
Before adding dependency updates, the relevant package config looks like this:
[packages.versioning]versioned_files = ["crates/knope-versioning/Cargo.toml"]The lock file can be added as a normal path. Because it has a specific file name, Knope knows what file type it is.
[packages.versioning]versioned_files = ["crates/knope-versioning/Cargo.toml", "Cargo.lock"]Knope will use the package.name field from the first Cargo.toml file to determine which package to update in Cargo.lock.
For the other Cargo.toml file, you must specify that a dependency within the file is what should be versioned,
not the package itself:
[packages.versioning]versioned_files = [ "crates/knope-versioning/Cargo.toml", "Cargo.lock", { path = "crates/knope/Cargo.toml", dependency = "knope-versioning" },]