Create multiproject build, add python grpc build support
This commit is contained in:
48
protobuf/build.gradle
Normal file
48
protobuf/build.gradle
Normal file
@@ -0,0 +1,48 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'com.google.protobuf'
|
||||
id 'idea'
|
||||
}
|
||||
|
||||
configurations {
|
||||
|
||||
// For grpc python codegen.
|
||||
python {
|
||||
canBeResolved = false
|
||||
canBeConsumed = true
|
||||
}
|
||||
}
|
||||
|
||||
protobuf {
|
||||
protoc { artifact = 'com.google.protobuf:protoc:3.11.0' }
|
||||
plugins {
|
||||
grpc {
|
||||
artifact = 'io.grpc:protoc-gen-grpc-java:1.28.1' // CURRENT_GRPC_VERSION
|
||||
}
|
||||
grpc_python { path = "$projectDir/grpc_python_plugin" }
|
||||
}
|
||||
generateProtoTasks {
|
||||
all().each { task ->
|
||||
task.builtins {
|
||||
java { option 'lite' }
|
||||
|
||||
python {}
|
||||
}
|
||||
task.plugins {
|
||||
grpc { // Options added to --grpc_out
|
||||
option 'lite'
|
||||
}
|
||||
grpc_python {
|
||||
outputSubDir = 'python'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'io.grpc:grpc-okhttp:1.28.1' // CURRENT_GRPC_VERSION
|
||||
implementation 'io.grpc:grpc-protobuf-lite:1.28.1' // CURRENT_GRPC_VERSION
|
||||
implementation 'io.grpc:grpc-stub:1.28.1' // CURRENT_GRPC_VERSION
|
||||
implementation 'javax.annotation:javax.annotation-api:1.2'
|
||||
}
|
||||
Reference in New Issue
Block a user