-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to the protoc code generator to avoid generating deprecate…
…d code (#3089) ### Motivation The generated ServiceTalk gRPC stubs make use of deprecated calls. This causes a problem when `-Werror` is used to build the code since it will automatically fail the build. We should allow users who have already migrated their code to prevent the protoc compiler from generating and using deprecated references. ### Modifications Add an option, `skipDeprecated`, as part of the protoc compiler configuration, to tell the generator to leave out deprecated references. Remove - initSerializationProvider, reason: ContentCodec is deprecated - isSupportedMessageCodingsEmpty, reason ContentCodec is deprecated - Deprecated ServiceFactory constructors - ServiceFactory::Builder references to ContentCodec - Generated client metadata and associated methods, reason: deprecated ### Result Users can generate gRPC stubs without deprecated code. ### Testing Manually tested: - Add new option to ServiceTalk/examples/grpc/protoc-options and use it to generate test_service.proto which covers all combinations of streaming (or not) services.
- Loading branch information
Showing
5 changed files
with
737 additions
and
484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.