Closed peter-lyons-kehl closed 5 years ago
An example is https://github.com/grpc/grpc-java/blob/master/services/src/main/proto/grpc/health/v1/health.proto, which has the generated Java classes on Maven Central.
So kroto does in fact generate coroutines clients. There’s no reflection involved. Setting up the codegen to run for an existing artifact from maven is trivial. The process is explained in detail here https://github.com/google/protobuf-gradle-plugin/blob/master/README.md#protos-in-dependencies
If you didn’t want to configure code gen then you could technically use the call builders directly. The generated stubs do this internally similar to the code generated by the default grpc java plugin. https://github.com/marcoferrer/kroto-plus/blob/e88d06241a129665c584aae709ddda61eeb121ef/kroto-plus-coroutines/src/main/kotlin/com/github/marcoferrer/krotoplus/coroutines/client/ClientCalls.kt#L59
Thank you.
May I admit ignorance of Kroto+ internals. Does Kroto+ require
.proto
file(s), or does it [afterprotoc
andjavac
] load the Java classes, inspects them by reflection, and generates the coroutines from them only?Say you have access to Java classes generated by protoc (for example, as artifacts from Maven). Removing a copy of
.proto
would mean one less step to maintain. (Of course, if the generated classes change, then the developer may have to update the coroutines, too.)