Closed mgodave closed 5 days ago
New diff from test_service.proto: https://gist.github.com/mgodave/5772193156ca740ea90ca11bafb3da56
Great work!
The generated code with
skipDeprecated=true
looks good. I also checked diff for default behavior. Many things changed their order, which is ok. Couldn't spot anything suspicious, but would be great if someone can have another look at the diff @bryce-anderson. We need to make sure current users won't be affected.
The ordering is probably based on me trying to keep the blocks of skipDeprecated
code together so that, at some point, we can more easily identify which sections can just be deleted. It should be fine, javapoet appears to at least do basic stuff like keep fields on top, etc... The only way current users would be affected would be if we changed anything else without the option. I didn't do a diff of a before and after. Let me do that as a quick check.
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.Result
Example: Tester.java before/after (option enabled) https://gist.github.com/mgodave/5772193156ca740ea90ca11bafb3da56 Example: Tester.java before/after (option disabled) https://gist.github.com/mgodave/dcff4574f0b70cb39c3bd97a859565ac
Remove
Testing
Manually tested: