-
Notifications
You must be signed in to change notification settings - Fork 499
Add SwiftProtobufPluginLibrary product.
#702
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
Conversation
This restores the `PluginLibrary` module as API for users of Swift Package Manager versions 4 or greater.
thomasvl
left a comment
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.
btw - out of curiosity, what type of plugin are you writing?
[email protected]
Outdated
| products: [ | ||
| .executable(name: "protoc-gen-swift", targets: ["protoc-gen-swift"]), | ||
| .library(name: "SwiftProtobuf", type: .static, targets: ["SwiftProtobuf"]), | ||
| .library(name: "SwiftProtobufPluginLibrary", targets: ["PluginLibrary"]), |
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.
Does it still need "SwiftProtobuf" on the front of the name since it is scoped to this package?
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 SwiftPM products share a global namespace (your package declares a dependency on one or more packages, and then your package's targets declare dependencies on targets and products), so the prefix is indeed required. Come to think of it Swift modules live in a global namespace as well, so it might be advisable to rename PluginLibrary to SwiftProtobufPluginLibrary. I'll update the PR with that change.
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.
Kevin: If you could just rename the directory, that seems like the best answer. (It will require fixing a few other references to get everything to compile cleanly again, of course.)
Thanks for helping with this kind of housekeeping!
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 problem, updated the PR.
Since Swift modules are exported into a global namespace, add a SwiftProtobuf prefix to PluginLibrary.
thomasvl
left a comment
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.
Letting @tbkka do final signoff and merge.
|
@thomasvl it's to do with protobuf and rpc, hmmm. |
|
@gmilos thanks. 😉 A lot of what went into the plugin lib was me, so feel free to reach out with PRs or directly in email about additions/etc. Having worked on two proto plugins now (ObjC and Swift), I'm hoping I exposed some reasonable helpers, but one never really knows until there are multiple consumers. |
|
I've got to do some releases for a few other opensource projects I work on, so I'll try to plow through this along with those today. |
A release will be cut to pick up apple#702.
A release will be cut to pick up #702.
|
Release 1.0.2 cut (and cocoapod spec pushed) |
This restores the
PluginLibrarymodule as API for users ofSwift Package Manager versions 4 or greater.