-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
61 lines (55 loc) · 1.59 KB
/
build.gradle.kts
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
group = "com.github.ochuerta.grpc"
version = "1.0-SNAPSHOT"
plugins {
java
id("com.google.protobuf") version "0.9.4"
idea
}
repositories {
mavenCentral()
}
dependencies {
// gRPC
runtimeOnly("io.grpc:grpc-netty-shaded:1.64.0")
implementation("io.grpc:grpc-protobuf:1.64.0")
implementation("io.grpc:grpc-stub:1.64.0")
implementation ("io.grpc:grpc-protobuf-lite:1.64.0")
compileOnly("org.apache.tomcat:annotations-api:6.0.53") // necessary for Java 9+
implementation ("org.slf4j:slf4j-api:1.7.36")
implementation ("ch.qos.logback:logback-classic:1.2.12")
// JUnit Jupiter API and Engine for unit testing
testImplementation("junit:junit:4.13.2")
testImplementation ("org.junit.jupiter:junit-jupiter-api:5.7.0")
testRuntimeOnly ("org.junit.jupiter:junit-jupiter-engine:5.7.0")
}
tasks.test {
useJUnitPlatform()
// Additional configurations can be added here
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.25.1"
}
plugins {
create("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:1.64.0"
}
}
generateProtoTasks {
all().forEach { task ->
task.builtins {
// Ensure 'java' builtin is not added if it already exists
if (!task.builtins.names.contains("java")) {
create("java") {
option("lite")
}
}
}
task.plugins {
create("grpc") {
option("lite")
}
}
}
}
}