I have an existing project which is using gradle with kotlin DSL. I have setup protobuf code auto-generation with gradle build.
Kotlin grpc code is generated and I am able to implement my backend using flows and coroutines.
But the kotlin DSL code is not getting generated. So I am currently left with usage of verbose boilerplate driven builder pattern for creating my objects.
Below is my protobuf plugin setup.
protobuf {
// generatedFilesBaseDir = "generated-sources"
protoc {
artifact = "com.google.protobuf:protoc:3.17.3"
}
plugins {
id("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:1.39.0"
}
id("grpckt") {
artifact = "io.grpc:protoc-gen-grpc-kotlin:1.2.0:jdk7@jar"
}
}
generateProtoTasks {
ofSourceSet("main").forEach {
it.plugins {
id("grpc") {}
id("grpckt") {}
}
}
}
}
Am I missing something here?