marcoferrer / kroto-plus

gRPC Kotlin Coroutines, Protobuf DSL, Scripting for Protoc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use kroto-plus as protoc plugin

Emixam23 opened this issue · comments

Hey !

I would like to know if this repo can be used as plugin for protoc? In fact I would like to generate the sources manually and using protoc, is that possible?

Thanks

Absolutely. This project is already implemented as a protoc plugin. There are example configurations for both Gradle and maven. It can also be used just like any other protoc plugin via direct execution of protoc

Hey ! Thanks, can you provide any example? or any details for a CLI use? And also what binary to download (to add to protoc plugin parameter)

I get an infinite loop while doing like this:

PROTOC_GEN_KOTLIN_PATH="/usr/local/lib/kroto-plus/gradlew"
protoc ${protofile} --proto_path . --plugin="protoc-gen-kotlin="${PROTOC_GEN_KOTLIN_PATH} --proto_path "${GOSRC}"/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --kotlin_out=./

If you are manually invoking the plugin you will need to download the executable protoc-gen-kroto-plus-0.5.0-jvm8.jar. Right now your environment variable is pointing to the gradle wrapper for building the project.

PROTOC_GEN_KOTLIN_PATH="path/too/protoc-gen-kroto-plus-0.5.0-jvm8.jar"