-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
75 lines (66 loc) · 1.85 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
import com.google.protobuf.gradle.*
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val grpcVersion = "1.31.1"
val grpcKotlinVersion = "0.1.5"
val protobufVersion = "3.13.0"
val coroutinesVersion = "1.3.9"
plugins {
application
kotlin("jvm") version "1.4.10"
id("com.google.protobuf") version "0.8.13"
}
group = "me.windows"
version = "1.0-SNAPSHOT"
repositories {
mavenLocal()
google()
jcenter()
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib"))
implementation("javax.annotation:javax.annotation-api:1.2")
implementation("com.google.protobuf:protobuf-java-util:$protobufVersion")
implementation("io.grpc:grpc-protobuf:$grpcVersion")
implementation("io.grpc:grpc-stub:$grpcVersion")
implementation("io.grpc:grpc-kotlin-stub:$grpcKotlinVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
runtimeOnly("io.grpc:grpc-netty-shaded:$grpcVersion")
testImplementation(kotlin("test-junit"))
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:$protobufVersion"
}
plugins {
id("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:$grpcVersion"
}
id("grpckt") {
artifact = "io.grpc:protoc-gen-grpc-kotlin:$grpcKotlinVersion"
}
}
generateProtoTasks {
ofSourceSet("main").forEach {
it.plugins {
id("grpc")
id("grpckt")
}
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
}
sourceSets {
main {
java {
srcDirs("build/generated/source/proto/main/grpc")
srcDirs("build/generated/source/proto/main/grpckt")
srcDirs("build/generated/source/proto/main/java")
}
}
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}