Skip to content

Conversation

@kevints
Copy link
Contributor

@kevints kevints commented Nov 14, 2017

This restores the PluginLibrary module as API for users of
Swift Package Manager versions 4 or greater.

This restores the `PluginLibrary` module as API for users of
Swift Package Manager versions 4 or greater.
Copy link
Collaborator

@thomasvl thomasvl left a 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?

products: [
.executable(name: "protoc-gen-swift", targets: ["protoc-gen-swift"]),
.library(name: "SwiftProtobuf", type: .static, targets: ["SwiftProtobuf"]),
.library(name: "SwiftProtobufPluginLibrary", targets: ["PluginLibrary"]),
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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!

Copy link
Contributor Author

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.
Copy link
Collaborator

@thomasvl thomasvl left a 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.

@gmilos
Copy link

gmilos commented Nov 15, 2017

@thomasvl it's to do with protobuf and rpc, hmmm.

@thomasvl
Copy link
Collaborator

thomasvl commented Nov 15, 2017

@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.

@tbkka tbkka merged commit ecc61a3 into apple:master Nov 15, 2017
@kevints kevints deleted the add-pluginlibrary-product branch December 1, 2017 17:39
@kevints
Copy link
Contributor Author

kevints commented Dec 1, 2017

Thanks for the reviews @thomasvl and @tbkka! Any idea when this patch might be released?

@thomasvl
Copy link
Collaborator

thomasvl commented Dec 4, 2017

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.

thomasvl added a commit to thomasvl/swift-protobuf that referenced this pull request Dec 4, 2017
A release will be cut to pick up apple#702.
@thomasvl thomasvl mentioned this pull request Dec 4, 2017
thomasvl added a commit that referenced this pull request Dec 4, 2017
A release will be cut to pick up #702.
@thomasvl
Copy link
Collaborator

thomasvl commented Dec 4, 2017

Release 1.0.2 cut (and cocoapod spec pushed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants