-
Notifications
You must be signed in to change notification settings - Fork 135
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
expose protoc-gen-grpc-swift as a gRPC generator #711
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
# grpc-swift depends on SwiftProtobuf to determine which modules need to be imported | ||
# into the generated .grpc.swift file for the generated .gRPC.swift file | ||
# | ||
# SwiftProtobuf explicitly disallows the current .proto file's module name | ||
# but when generating the .grpc.swift and .pb.swift files to different locations | ||
# one MUST import the current .proto file's module name | ||
if ctx.attr.protoc_plugin_name == "grpc-swift": | ||
proto_module_name = deps[0][SwiftInfo].direct_modules[0].name | ||
extra_module_imports.append(proto_module_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 seems like a hack that i don't want to commit to rules_swift. we should have a better way to determine if we want to exclude the current module or not, but that involves at least two upstream tickets (against grpc-swift and swift-protobuf).
Up until now rules_swift only exposed
protoc-gen-swiftgrpc
, the 0.x gRPC generated for Swift. This PR adds support for the 1.x gRPC generator,protoc-gen-grpc-swift
.protoc-gen-grpc-swift
generates code that depends onGPRC
andNIO
, so most of the code in this PR is setting up builds forGRPC
andNIO
. Not sure if this needs to live inrules_swift
, but it's good enough for now 🙂Some remaining todos:
.grpc.swift
files can't compile because they don't import their accompanying.pb.swift
SwiftGRPC
forswiftgrpc
,GRPC
/NIO
forgrpc-swift
)