question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create @GrpcClass annotation processor hook for generated source files.

See original GitHub issue

To write an annotation processor that further augments the generated source from the grpc protoc plugin is a little difficult.

Currently, I process @Generated annotations and search for value ~= /gRpc/.

As an external example, looking at the new grpc-dagger in 2.11 (google/dagger#647), the additional dagger code generation is triggered off of an annotation applied to the implementing class. It would be nice to have all the code generation based off of the gprc classes. Right now it feels like a two step process. Add the proto, generate the grpc stub, implement the stub, add the processor annotation, compile again for the additional code.

WDYT?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ejona86commented, Jul 7, 2018

This was partially addressed in #4609. The RpcService still doesn’t have an annotation, but it could follow in the same vein.

0reactions
MostafaAmer-2commented, Oct 23, 2020

@daicoden What plugin are you using to allow dagger to create the auto generated files upon compilation? I’ve referenced my issue on the Dagger project https://github.com/google/dagger/issues/2157. Your help is greatly appreciated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java Annotation Processing and Creating a Builder - Baeldung
A quick and practical guide to annotation processing in Java, showing you how to create a builder from a POJO.
Read more >
Java Annotation Processor: only generate a source file if it ...
I want to be able to generate a source file once, and then allow it to be edited manually by a developer without...
Read more >
2 posts tagged with "http" - Apache ShenYu
The ShenyuClientRegisterRepository generated in the configuration file above is a concrete implementation of the client registration, which is an interface with ...
Read more >
chore(deps): update dependency io.quarkus:quarkus ... - GitLab
... #​25193 - Use plain old load class in RR generated code ... #​24028 - Use a copy of compile classpath for panache...
Read more >
Code Generation using Annotation Processors in the Java ...
Now, in part 3, we are going to show how an Annotation Processor can be used to generate source code. Code Generation using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found