-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
101 lines (87 loc) · 2.6 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import com.google.protobuf.gradle.*
plugins {
id("org.jetbrains.kotlin.jvm") version "1.4.32"
id("org.jetbrains.kotlin.kapt") version "1.4.32"
id("com.github.johnrengelman.shadow") version "7.0.0"
id("io.micronaut.application") version "1.5.3"
id("org.jetbrains.kotlin.plugin.allopen") version "1.4.32"
id("com.google.protobuf") version "0.8.15"
}
version = "0.1"
group = "org.seariver"
val kotlinVersion=project.properties.get("kotlinVersion")
repositories {
mavenCentral()
}
micronaut {
testRuntime("junit5")
processing {
incremental(true)
annotations("org.seariver.*")
}
}
dependencies {
implementation("io.micronaut:micronaut-runtime")
implementation("io.micronaut.grpc:micronaut-grpc-runtime")
implementation("io.micronaut.kotlin:micronaut-kotlin-runtime")
implementation("io.micronaut:micronaut-validation")
implementation("io.micronaut.sql:micronaut-jdbc-hikari")
implementation("org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlinVersion}")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3")
implementation("io.grpc:grpc-kotlin-stub:1.1.0")
implementation("javax.annotation:javax.annotation-api")
runtimeOnly("org.postgresql:postgresql")
runtimeOnly("ch.qos.logback:logback-classic")
runtimeOnly("com.fasterxml.jackson.module:jackson-module-kotlin")
testImplementation("io.micronaut:micronaut-http-client")
}
application {
mainClass.set("org.seariver.ApplicationKt")
}
java {
sourceCompatibility = JavaVersion.toVersion("11")
}
tasks {
compileKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "11"
}
}
}
sourceSets {
main {
java {
srcDirs("build/generated/source/proto/main/grpc")
srcDirs("build/generated/source/proto/main/grpckt")
srcDirs("build/generated/source/proto/main/java")
}
}
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.17.2"
}
plugins {
id("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:1.38.0"
}
id("grpckt") {
artifact = "io.grpc:protoc-gen-grpc-kotlin:1.1.0:jdk7@jar"
}
}
generateProtoTasks {
ofSourceSet("main").forEach {
it.plugins {
// Apply the "grpc" plugin whose spec is defined above, without options.
id("grpc")
id("grpckt")
}
}
}
}