mirror of
https://github.com/rust-lang/cargo
synced 2024-10-13 11:12:25 +00:00
60e65eefb2
Add `--public` for `cargo add` ## What does this PR try to resolve? Complete https://github.com/rust-lang/cargo/issues/13037 This PR want to add `--public/--no public` flag for `cargo add` Note: this assumes we'll remove workspace inheritance support for `public` as it sounds like we'll be reverting it https://github.com/rust-lang/rust/issues/44663#issuecomment-1826474620. If we decide to keep workspace inheritance, we'll need to come back and update this. ## How should we test and review this PR? Most of Code were reference `cargo add --optional`, So can reviewed the new code based on the part of `optional` code. The new testcases were origin from the `cargo add --optional` part. - `public` testcase:there is no dependencies and will be add `public` dependencies. - `no_public` testcase: there is no dependencies and will be add `no_public` dependencies. - `overwrite_public` testcase: the dependencies already exists but will be overwrite with `public`. - `overwrite_no_public` testcase: the dependencies already exists but will be overwrite with `no_public`. - `overwrite_public_with_no_public` testcase: the dependencies already marked as `no_public` and will be overwrite with `public`. - `overwrite_no_public_with_public` testcase: the dependencies already marked as `public` and will be overwrite with `no_public`. |
||
---|---|---|
.. | ||
build-std | ||
testsuite |