-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
104 lines (94 loc) · 2.99 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
102
103
104
import com.google.protobuf.gradle.*
plugins {
id("org.jetbrains.kotlin.jvm") version "1.5.0"
id("org.jetbrains.kotlin.kapt") version "1.5.0"
id("com.github.johnrengelman.shadow") version "7.0.0"
id("io.micronaut.application") version "1.5.0"
id("org.jetbrains.kotlin.plugin.allopen") version "1.5.0"
id("org.jetbrains.kotlin.plugin.jpa") version "1.5.0"
id("com.google.protobuf") version "0.8.15"
}
version = "0.1"
group = "com.example"
val kotlinVersion=project.properties.get("kotlinVersion")
repositories {
mavenCentral()
}
micronaut {
testRuntime("junit5")
processing {
incremental(true)
annotations("com.example.*")
}
}
dependencies {
kapt("io.micronaut.data:micronaut-data-processor")
implementation("io.grpc:grpc-kotlin-stub:1.1.0")
implementation("io.micronaut:micronaut-validation")
implementation("io.micronaut:micronaut-runtime")
implementation("io.micronaut.data:micronaut-data-hibernate-jpa")
implementation("io.micronaut.grpc:micronaut-grpc-runtime")
implementation("io.micronaut.kotlin:micronaut-kotlin-runtime")
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-jvm:${kotlinVersion}")
implementation("javax.annotation:javax.annotation-api")
runtimeOnly("ch.qos.logback:logback-classic")
runtimeOnly("org.postgresql:postgresql")
runtimeOnly("com.fasterxml.jackson.module:jackson-module-kotlin")
testImplementation("org.testcontainers:junit-jupiter")
testImplementation("org.testcontainers:postgresql")
testImplementation("org.testcontainers:testcontainers")
testImplementation("io.micronaut:micronaut-http-client")
testImplementation("org.mockito:mockito-core")
}
application {
mainClass.set("com.example.ApplicationKt")
}
java {
sourceCompatibility = JavaVersion.toVersion("14")
}
tasks {
compileKotlin {
kotlinOptions {
jvmTarget = "14"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "14"
}
}
}
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.0"
}
plugins {
id("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:1.33.1"
}
id("grpckt") {
artifact = "io.grpc:protoc-gen-grpc-kotlin:0.1.5"
}
}
generateProtoTasks {
ofSourceSet("main").forEach {
it.plugins {
// Apply the "grpc" plugin whose spec is defined above, without options.
id("grpc")
id("grpckt")
}
}
}
}