Just for fun tried to convert my sample app build ...
# gradle
g
Just for fun tried to convert my sample app build script to kotlin-dsl with protobuf and grpc plugins And looks not so good, but at least it works: Groovy:
Copy code
protobuf {
    protoc {
        artifact = "com.google.protobuf:protoc:3.2.0"
    }
    plugins {
        grpc {
            artifact = "io.grpc:protoc-gen-grpc-java:1.3.0"
        }
    }
    generateProtoTasks {
        all().each { task ->
            task.plugins {
                grpc {}
            }
        }
    }
}
Kotlin
Copy code
protobuf {
    protobuf(delegateClosureOf<ProtobufConfigurator> {
        protoc(delegateClosureOf<ExecutableLocator> {
            artifact = "com.google.protobuf:protoc:3.2.0"
        })

        plugins(delegateClosureOf<NamedDomainObjectContainer<ExecutableLocator>> {
            invoke {
                "grpc" {
                    artifact = "io.grpc:protoc-gen-grpc-java:1.3.0"
                }
            }
        })

        generateProtoTasks(delegateClosureOf<ProtobufConfigurator.GenerateProtoTaskCollection> {
            val all: Collection<GenerateProtoTask> = all()
            all.forEach { task ->
                task.plugins {
                    "grpc" {}
                }
            }
        })
    })
}