-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
67 lines (60 loc) · 1.5 KB
/
build.gradle.kts
File metadata and controls
67 lines (60 loc) · 1.5 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import com.google.protobuf.gradle.generateProtoTasks
import com.google.protobuf.gradle.id
import com.google.protobuf.gradle.ofSourceSet
import com.google.protobuf.gradle.plugins
import com.google.protobuf.gradle.protobuf
import com.google.protobuf.gradle.protoc
plugins {
`java-library`
id("com.google.protobuf") version "0.8.15"
id("org.hypertrace.publish-plugin")
}
val generateLocalGoGrpcFiles = false
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.17.3"
}
plugins {
id("grpc_java") {
artifact = "io.grpc:protoc-gen-grpc-java:1.45.1"
}
if (generateLocalGoGrpcFiles) {
id("grpc_go") {
path = "<go-path>/bin/protoc-gen-go"
}
}
}
generateProtoTasks {
ofSourceSet("main").forEach {
it.plugins {
// Apply the "grpc" plugin whose spec is defined above, without options.
id("grpc_java")
if (generateLocalGoGrpcFiles) {
id("grpc_go")
}
}
it.builtins {
java
if (generateLocalGoGrpcFiles) {
id("go")
}
}
}
}
}
sourceSets {
main {
java {
srcDirs("src/main/java", "build/generated/source/proto/main/java", "build/generated/source/proto/main/grpc_java")
}
}
}
dependencies {
api("com.google.protobuf:protobuf-java-util:3.18.2")
implementation("org.slf4j:slf4j-api:1.7.30")
constraints {
implementation("com.google.code.gson:gson:2.8.9") {
because("https://snyk.io/vuln/SNYK-JAVA-COMGOOGLECODEGSON-1730327")
}
}
}