-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add swift package add-target-dependency
command to edit the manifest
#7594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add swift package add-target-dependency
command to edit the manifest
#7594
Conversation
Introduce a command to add a new dependency to a target in the manifest file, exposing the newly-added API to the command line. Here's the help output: OVERVIEW: Add a new target dependency to the manifest USAGE: swift package add-target-dependency <dependency-name> <target-name> [--package <package>] ARGUMENTS: <dependency-name> The name of the new dependency <target-name> The name of the target to update OPTIONS: --package <package> The package in which the dependency resides --version Show the version. -h, -help, --help Show help information.
@swift-ci please test |
Would this be more natural as: swift package target add-dependency ... which could live parallel to API like: swift package target init <name> [--type <executable, target, module>]
swift package target rename <name> <new-name>
swift package target remove-dependency ... |
According to SE-0301, there was some discussion of having this "fourth level" of command when that proposal was reviewed, and we decided against it then. But maybe with us adding more of these commands now, it's worth re-opening the discussion. |
👍 That SE is so old I had entirely forgotten about it. It's probably worth revisiting the names in a future proposal. |
I put up a pitch thread at https://forums.swift.org/t/package-manifest-editing-commands-beyond-se-0301/72085 to discuss |
I reimplemented all of it almost exactly before learning about it. Whoops! |
swiftlang#7594) Introduce a command to add a new dependency to a target in the manifest file, exposing the newly-added API to the command line. Here's the help output: OVERVIEW: Add a new target dependency to the manifest USAGE: swift package add-target-dependency <dependency-name> <target-name> [--package <package>] ARGUMENTS: <dependency-name> The name of the new dependency <target-name> The name of the target to update OPTIONS: --package <package> The package in which the dependency resides --version Show the version. -h, -help, --help Show help information. (cherry picked from commit 15ac439)
…anifest (#7628) **Explanation**: Building on SE-0301, add a new command `swift package add-target-dependency` to edit the package manifest and add a new dependency to a given target. **Original** PR: #7594 **Risk**: Low. New, very simple code path to edit the package manifest in a narrow way. **Reviewed by**: @MaxDesiatov
Introduce a command to add a new dependency to a target in the manifest file, exposing the newly-added API to the command line. Here's the help output: