Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 templates for build tool plugins and command plugins #6111
Add templates for build tool plugins and command plugins #6111
Changes from 6 commits
472e441
15905c9
1779745
dc414f2
95784f7
1e0d950
1af80a4
807d96d
6340897
32501f6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
A more full-fledged starting point would be to have a shared function between the SwiftPM and Xcode API, and some boilerplate to construct a sample build command. Not sure how far to go in that direction.
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.
I think having a sample build command would be good.
A bit less sure about how to handle Xcode vs. SwiftPM plugins, on the one hand, shared function is obviously the right thing for many use cases, on the other hand it could potentially make it confusing that the two entry points even exist?
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.
cc @bitjammer @TimTr for opinions on the content of these templates
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.
In the long run, it might make sense to have an option for whether or not to add the Xcode specifics. We can leave it out for now but maybe include the URL of the plugins Markdown here in the SwiftPM repository, which talks about how to add them. That would seem to be in line with how the argument parser template works (it puts in this comment:
// https://swiftpackageindex.com/apple/swift-argument-parser/documentation
).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.
@tomerd good point that these seem to be using the older style of always having a
/Sources/<target>/
folder structure. With the updated templates for executables using just/Sources/
the base templates can start a bit cleaner. Also note this PR: #6294 which makes the SwiftPM folder search path work with/Sources/
by default (no need for apath:
entry), and also work with the traditional per-target folder model. So either option is now supported by default.I don't have a strong opinion for these templates using the traditional or simplified model. But if the common case will be a single target, may be nice to stick with the simpler approach.
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.
Simplified model sounds good given that the manifest doesn't have to be made more complicated. I'll update the PR. Thanks!
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.
@TimTr What about the point about whether or not to include the optional XcodeProjectPlugin support to make it easier for new plugins to work with Xcode projects out-of-the-box.
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.
Anything specific to Xcode feels like it shouldn't be there by default in the CLI tools. I could see an option (making the command pretty long to manually type, but trivial for tooling) to support tools like Xcode, or VSCode, or others. This could then be used when a user is inside Xcode already, pretty seamlessly, without implying to the rest of the Swift world that Swift is tied to Xcode.