x80486
08/14/2017, 12:01 PMprotobuf
plug-in from Gradle. This is what I got so far:
configure<ProtobufConfigurator> { //protobuf
generatedFilesBaseDir = "$projectDir/build/generated"
//generateProtoTasks {
// all() * . plugins {
// grpc { option "enable_deprecated = false" }
// }
//}
generateProtoTasks({ ??? })
//plugins {
// grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpc_version}" }
//}
// protoc {
// artifact = "com.google.protobuf:protoc:3.3.0"
// }
}
gildor
08/14/2017, 1:19 PMgildor
08/14/2017, 1:21 PMgildor
08/14/2017, 1:22 PMx80486
08/14/2017, 2:00 PMgildor
08/14/2017, 3:21 PMAction<T>
based API.
kotlin-dsl provides few helper functions like delegateClosureOf to work with Groovy Closure
class and setProperty
and invokeMethod
to work with dynamic properties and methods of closurex80486
08/15/2017, 1:41 AM./gradlew clean build
I'm getting a lot of `Unresolve reference: blah blah`; I think it's because compileKotlin
runs before generateProto
and it can't find the "generated" classes/stubs from gRPC.
Are you facing the same?x80486
08/15/2017, 1:42 AMgildor
08/15/2017, 1:48 AMjava.sourceSets["main"].java {
val gen = protobuf.protobuf.generatedFilesBaseDir
srcDirs += files("$gen/main/java", "$gen/main/grpc")
}
gildor
08/15/2017, 2:06 AMx80486
08/15/2017, 2:08 AMgildor
08/15/2017, 2:13 AMx80486
08/15/2017, 2:16 AMgildor
08/15/2017, 4:39 AMgildor
08/15/2017, 4:40 AM