-
Notifications
You must be signed in to change notification settings - Fork 419
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
Allow the gRPC module name to be customised when generating code #945
Conversation
7b04aa8
to
82c6f7b
Compare
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.
Could you please also document this in https://github.com/grpc/grpc-swift/blob/main/docs/plugin.md?
This "fixes #915." If you encounter conflicting module names, please follow this process:
Whenever we tag a new release, I'm afraid you will need to repeat steps 1 and 2 (or manually increment |
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.
Looks good. I wonder whether we should also include the steps from my comment, WDYT?
If anything I'd think they should be included in the README, I suspect If someone hits this they might search the README but will be unlikely to look in the plugin docs. |
Motivation: Some Cocoapods may find themselves in a situation where their dependency graph contains both gRPC Swift and the gRPC core library. This is problematic since both have the same module name ("GRPC"). Changing our own module name is a very large breaking change and one we'd like to avoid. As an escape valve, users who take a direct dependency on us may rename our module via their Podfile; doing so would require their generated code to depend on that module, rather than the currently hardcoded 'GRPC' module. Modifications: - Add an option to the codegen to specify the gRPC module name - Remove a couple of imports which were previously used but are now no longer require - Regenerate Result: It's possible for Cocoapods users to take a direct dependency on gRPC Swift and libgrpc.
Fine with me as well. Maybe just mention in the README to look here when encountering this particular issue? |
c30099b
to
9a6012b
Compare
Please note that the option for protobuf codegen is |
Hello everyone, How can the mentioned solution work when |
@nshoura |
Motivation:
Some Cocoapods may find themselves in a situation where their dependency
graph contains both gRPC Swift and the gRPC core library. This is
problematic since both have the same module name ("GRPC"). Changing our
own module name is a very large breaking change and one we'd like to avoid.
As an escape valve, users who take a direct dependency on us may rename
our module via their Podfile; doing so would require their generated
code to depend on that module, rather than the currently hardcoded
'GRPC' module.
Modifications:
longer required
Result:
It's possible for Cocoapods users to take a direct dependency on gRPC
Swift and libgrpc.