-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
76 lines (68 loc) · 2.09 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
import com.google.protobuf.gradle.*
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
id("com.google.protobuf") version "0.8.17"
kotlin("jvm") version "1.5.30-M1"
}
group = "ru.orlovich.group"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
sourceSets{
main {
java {
srcDir ("build/generated/source/proto/main/grpc")
srcDir ("build/generated/source/proto/main/java")
}
}
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.1")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.7.1")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.7.1")
testImplementation("org.assertj:assertj-core:3.6.1")
implementation ("org.grpcmock:grpcmock-junit5:0.5.5")
implementation ("io.grpc:grpc-all:1.39.0")
implementation( "com.google.protobuf:protobuf-java:3.17.2")
if (JavaVersion.current().isJava9Compatible) {
// Workaround for @javax.annotation.Generated
// see: https://github.com/grpc/grpc-java/issues/3633
compileOnly("javax.annotation:javax.annotation-api:1.3.1")
}
implementation(kotlin("stdlib-jdk8"))
}
tasks.getByName<Test>("test") {
useJUnitPlatform()
}
protobuf {
protoc {
// The artifact spec for the Protobuf Compiler
artifact = "com.google.protobuf:protoc:3.17.2"
}
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.39.0"
}
}
generateProtoTasks {
all().forEach {
it.plugins {
// Apply the "grpc" plugin whose spec is defined above, without options.
id("grpc")
}
}
}
}
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
jvmTarget = "1.8"
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
jvmTarget = "1.8"
}