-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
83 lines (74 loc) · 2.42 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
77
78
79
80
81
82
83
import com.google.protobuf.gradle.*
plugins {
kotlin("jvm") version "1.9.23"
id("com.google.protobuf") version "0.9.4"
}
group = "org.example"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
protobuf {
protoc {
// The artifact spec for the Protobuf Compiler
artifact = "com.google.protobuf:protoc:3.6.1"
}
plugins {
// Optional: an artifact spec for a protoc plugin, with "grpc" as
// the identifier, which can be referred to in the "plugins"
// container of the "generateProtoTasks" closure.
id("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:1.15.1"
}
}
generateProtoTasks {
ofSourceSet("main").forEach {
it.plugins {
// Apply the "grpc" plugin whose spec is defined above, without
// options. Note the braces cannot be omitted, otherwise the
// plugin will not be added. This is because of the implicit way
// NamedDomainObjectContainer binds the methods.
id("grpc") { }
}
}
}
// generateProtoTasks {
// all().forEach { task ->
// task.plugins {
// id("grpc")
// id("grpckt")
// }
// }
// }
}
dependencies {
implementation("io.grpc:grpc-netty-shaded:1.57.0")
implementation("io.grpc:grpc-protobuf:1.57.0")
implementation("io.grpc:grpc-stub:1.57.0")
implementation("com.google.protobuf:protobuf-kotlin:3.22.0")
implementation("io.grpc:grpc-kotlin-stub:1.3.0")
implementation("javax.annotation:javax.annotation-api:1.3.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("io.ktor:ktor-client-core:2.3.12")
testImplementation("io.ktor:ktor-client-cio:2.3.12")
testImplementation("org.mockito:mockito-core:4.0.0")
testImplementation("org.mockito:mockito-inline:4.0.0")
testImplementation("org.mockito:mockito-junit-jupiter:4.0.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1")
}
sourceSets {
main {
java {
srcDirs("build/generated/source/proto/main/java")
srcDirs("build/generated/source/proto/main/grpc")
}
}
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(11)
}