-
Notifications
You must be signed in to change notification settings - Fork 16
/
proto.gradle
38 lines (33 loc) · 1.04 KB
/
proto.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
apply plugin: 'com.google.protobuf'
sourceSets {
main {
proto {
// In addition to the default 'src/main/proto'
srcDir file('src/main/java')
}
java {
srcDir layout.buildDirectory.dir('./generated/source/proto/main/java').get().asFile
srcDir layout.buildDirectory.dir('./generated/source/proto/main/grpc').get().asFile
}
}
}
configurations.all {
resolutionStrategy {
dependencySubstitution {
substitute module("com.google.protobuf:protobuf-javalite") using module("com.google.protobuf:protobuf-java:${protobufVersion}")
}
}
}
dependencies {
implementation "com.google.protobuf:protobuf-java:${protobufVersion}"
implementation "com.google.protobuf:protobuf-java-util:${protobufVersion}"
}
protobuf {
protoc { artifact = "com.google.protobuf:protoc:${protocVersion}" }
plugins {
grpc { artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}" }
}
generateProtoTasks {
all()*.plugins { grpc {} }
}
}