-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add-dependency command updates all manifests #9285
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
base: main
Are you sure you want to change the base?
Conversation
|
There is still needing tests + option to specify the manifest files a user wants to add-dependencies to. |
|
Furthermore, I think that on top of add-dependency, other similar subcommands, such as add-target and add-product, should also support this logic |
| // Find version specific manifests | ||
| do { | ||
| let packageContents = try fileSystem.getDirectoryContents(packagePath) | ||
| let regexManifestFile = try! RegEx(pattern: #"^Package@swift-(\d+)(?:\.(\d+))?(?:\.(\d+))?.swift$"#) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: Is there some reusable regex or function that can find all of the package manifests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, sadly there is not a reusable regex. Furthermore, the only function that is used for finding package manifests only returns one (which is required for the manifest loader, as you would not load multiple manifests)
|
This change looks good to me. If there were some tests I think that it can be flipped to "ready for review." |
|
@swift-ci please test |
Add-dependency will update all manifest files in a swift package
Motivation:
#9248
Modifications:
Essentially, just added a function to query all possible manifest files, then apply edits to each one.
Result:
Now, add-dependency can edit multiple manifests at the same time such as swift argument parser.