我的build.gradle能够为Go生成protobuf代码。我需要更改什么才能为Go代码生成grpc代码?
apply plugin: 'com.google.protobuf'
buildscript {
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3'
}
}
def grpcVersion = '1.11.0'
dependencies {
compile "io.grpc:grpc-netty:${grpcVersion}"
compile "io.grpc:grpc-protobuf:${grpcVersion}"
compile "io.grpc:grpc-stub:${grpcVersion}"
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.5.1-1"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all().each { task ->
task.builtins {
go { }
}
}
all()*.plugins {
grpc {}
}
}
}