-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
76 lines (62 loc) · 1.75 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
plugins {
id("java")
id("application")
id("com.google.protobuf") version "0.9.4"
}
group = "org.example"
version = "1.0-SNAPSHOT"
repositories {
maven {
url = uri("https://maven-central.storage-download.googleapis.com/maven2/")
}
mavenCentral()
mavenLocal()
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
val grpcVersion = "1.58.0" // CURRENT_GRPC_VERSION
val protobufVersion = "3.24.0"
val protocVersion = protobufVersion
dependencies {
implementation("io.grpc:grpc-netty-shaded:1.54.0")
implementation("io.grpc:grpc-protobuf:$grpcVersion")
implementation("io.grpc:grpc-services:$grpcVersion")
implementation("io.grpc:grpc-stub:$grpcVersion")
implementation("com.fasterxml.jackson.core:jackson-databind:2.15.2") // added for performacne testing of json vs proto
compileOnly("org.apache.tomcat:annotations-api:6.0.53")
testImplementation(platform("org.junit:junit-bom:5.9.1"))
testImplementation("org.junit.jupiter:junit-jupiter")
}
// this guy is responsible for reading the proto file and generating the java class required according to the protofile.
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protocVersion}"
}
plugins {
create("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all().forEach { task ->
task.plugins {
create("grpc")
}
}
}
}
sourceSets {
main{
proto{
srcDir("${projectDir}/src/main/proto")
}
}
}
tasks.test {
useJUnitPlatform()
}
tasks.processResources {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}