Closed Marcus-Rosti closed 4 years ago
Thanks for the feature request!
We might be pretty close to this, since we're already packaging up the code generation into jars with a main class to be used from the Gradle plugin:
So it might be that all that's needed is to package those up a bit nicer and provide documentation on how to use them.
I'd be interested to hear how this goes!
I tried a good deal today to get the gradle plugin to be more executable friendly. But I nobly failed. I may just have to table this (my) project until y'all can do that! I'll keep watching the PRs!
Is there anything in particular you were having a hard time with? I'd be happy to try and give some more pointers.
I think both akka-grpc-codegen and akka-grpc-scalapb-protoc-plugin expect a CodeGeneratorRequest
object on stdin
(serialized with protobuf).
I'm not too familiar with Bazel, but I could imagine you could try:
CodeGeneratorRequest
ourselves based on thoseSO looks like it's pretty hard to get protoc to generate that intermediate form CodeGeneratorRequest
just via the command line. It's does that via the plugin field for protoc a la scalapb: https://scalapb.github.io/scalapbc.html#using-scalapb-as-a-proper-protoc-plugin and https://github.com/scalapb/ScalaPB/blob/master/build.sbt#L302-L336
I think I'll have to package the codegen package here similarly.
I think I'll have to package the codegen package here similarly.
You should be able to use the codegen assembly jar (e.g. https://repo1.maven.org/maven2/com/lightbend/akka/grpc/akka-grpc-codegen_2.12/0.7.1/akka-grpc-codegen_2.12-0.7.1-assembly.jar) in this way I think.
I got this all to work! Thanks
@ Marcus-Rosti I'm just starting to investigate using Bazel would it be possible for you to post a link to a repo that shows an example of what you did?
Update: https://github.com/akka/akka-grpc/issues/744#issuecomment-566580088
Short description
There should be a way to run the compiler in some standalone fashion. I've been trying to move our services to a monorepo built with bazel but there doesn't appear to be a way to standalone compile the protos to the akka-grpc style code.
Details
Build an executable jar and CLI for the akka-grpc scalapb compiler