-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
protobuf.gradle
39 lines (35 loc) · 888 Bytes
/
protobuf.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Boilerplate configuration that should be included whenever protobufs are used
// see e.g. index-api's build.gradle
protobuf {
protoc {
if (osdetector.os == "osx") {
artifact = "com.google.protobuf:protoc:3.0.2:osx-x86_64"
} else {
artifact = "com.google.protobuf:protoc:3.0.2"
}
}
plugins {
grpc {
if (osdetector.os == "osx") {
artifact = "io.grpc:protoc-gen-grpc-java:1.1.2:osx-x86_64"
} else {
artifact = "io.grpc:protoc-gen-grpc-java:1.1.2"
}
}
}
generateProtoTasks {
all().each { task ->
task.plugins {
grpc {}
}
}
}
}
tasks.compileJava.dependsOn('generateProto')
sourceSets {
main {
proto {
srcDirs += 'src/main/protobuf'
}
}
}