-
Notifications
You must be signed in to change notification settings - Fork 435
Add Generation of gRPC-Swift.podspec #869
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 Generation of gRPC-Swift.podspec #869
Conversation
|
|
Jake-Prickett
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.
Script changes look good! Would it be worth it to add any information about this in the Cocoapods Section of the README?
glbrntt
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.
Good start @Lutzifer -- I've left some comments and questions.
scripts/build_podspecs.py
Outdated
| if self.module_name: | ||
| podspec += indent + "s.source = { :git => \"https://github.com/grpc/grpc-swift.git\", :tag => s.version }\n\n" | ||
| else: | ||
| podspec += indent + "s.source = { :http => \"https://github.com/grpc/grpc-swift/releases/download/#{s.version}/protoc-swift-plugins-#{s.version}.zip\"}\n\n" |
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 we need to be more specific with the naming here: protoc-grpc-swift-plugins-VERSION-macOS-x86_64.zip
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.
Added -macOS-x86_64.zip for now, but it is not yet dynamic
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.
Still missing grpc from the name.
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.
This one also hasn't been resolved yet.
|
Caveat: In this configuration, the Licence File must be included in the zip file along with the two plugins. |
gRPC-Swift-Plugins.podspec
Outdated
| s.homepage = 'https://www.grpc.io' | ||
| s.authors = { 'The gRPC contributors' => 'grpc-packages@google.com' } | ||
|
|
||
| s.source = { :http => "https://github.com/grpc/grpc-swift/releases/download/#{s.version}/protoc-swift-plugins-#{s.version}-macOS-x86_64.zip"} |
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.
Sorry I think I've changed my position on this slightly: we need to wary of the fact that Macs on Apple Silicon are a thing. Either we need separate pods: or we should structure the zip appropriately and bundle them up together. What do you think @MrMage?
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 including binaries for both architectures in the zip either in folders or as fat binaries if possible would be better than having separate pods.
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 will change the name of the zip again, then.
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.
(Unresolving since I'd like to hear @MrMage's opinion here)
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.
Full-fledged Mac app bundles can be distributed as a "fat" binary containing both architectures. Would that be a possibility here as well?
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.
When looking at the project generated by "make project" I would dare to say that this should be possible. Have not tried it in xcode12 though.
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.
Not sure if that would work or not. I don't think the details are important at the moment though; the relevant question is do we distribute them in a single zip? It seems like we have consensus that we should.
glbrntt
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.
I'm pretty much happy with this. I'd just like to hear @MrMage's opinion before approving.
scripts/build_podspecs.py
Outdated
| if self.module_name: | ||
| podspec += indent + "s.source = { :git => \"https://github.com/grpc/grpc-swift.git\", :tag => s.version }\n\n" | ||
| else: | ||
| podspec += indent + "s.source = { :http => \"https://github.com/grpc/grpc-swift/releases/download/#{s.version}/protoc-swift-plugins-#{s.version}.zip\"}\n\n" |
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.
Still missing grpc from the name.
gRPC-Swift-Plugins.podspec
Outdated
| @@ -0,0 +1,15 @@ | |||
| Pod::Spec.new do |s| | |||
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.
This has been useful to see in the review but I don't think we should publish it to master yet (since the zip doesn't exist and no pod has been pushed).
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.
This one hasn't been resolved yet.
Co-authored-by: George Barnett <gbrntt@gmail.com>
Motivation: grpc#869 adds a plugin containing the protoc binaries for CocoaPods. It relies on having a zip of the binaries in the tagged release. Modifications: - Add a script to generate a zip of the protoc binaries. Result: We can generate a bundle of plugins which may be pulled in by a CocoaPod.
glbrntt
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.
This is ready to go aside from a couple of comments which haven't been addressed yet.
gRPC-Swift-Plugins.podspec
Outdated
| @@ -0,0 +1,15 @@ | |||
| Pod::Spec.new do |s| | |||
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.
This one hasn't been resolved yet.
scripts/build_podspecs.py
Outdated
| if self.module_name: | ||
| podspec += indent + "s.source = { :git => \"https://github.com/grpc/grpc-swift.git\", :tag => s.version }\n\n" | ||
| else: | ||
| podspec += indent + "s.source = { :http => \"https://github.com/grpc/grpc-swift/releases/download/#{s.version}/protoc-swift-plugins-#{s.version}.zip\"}\n\n" |
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.
This one also hasn't been resolved yet.
glbrntt
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.
Great stuff, thanks @Lutzifer!
Motivation: #869 adds a plugin containing the protoc binaries for CocoaPods. It relies on having a zip of the binaries in the tagged release. Modifications: - Add a script to generate a zip of the protoc binaries. Result: We can generate a bundle of plugins which may be pulled in by a CocoaPod.
Motivation: grpc/grpc-swift#869 adds a plugin containing the protoc binaries for CocoaPods. It relies on having a zip of the binaries in the tagged release. Modifications: - Add a script to generate a zip of the protoc binaries. Result: We can generate a bundle of plugins which may be pulled in by a CocoaPod.

This implements the automatic Podspec Generation part for plugins as discussed in #802
As there was some discussion about Automating Releases (see #830 ) via Github Actions, I left the uploading part of the plugins to Github manual for now.