-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
80 lines (62 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
76
77
78
79
80
import com.google.protobuf.gradle.*
plugins {
kotlin("jvm") version "1.9.0"
id("com.google.protobuf") version "0.8.19"
application
}
repositories {
mavenCentral()
maven(url = "https://packages.confluent.io/maven/")
}
val kcVersion by extra { "23.0.3" }
val gsonVersion by extra { "2.2.4" }
val kafkaVersion by extra { "2.1.0" }
group = "com.github.yuri-potatoq"
version = "1.0-SNAPSHOT"
dependencies {
testImplementation(kotlin("test"))
listOf(
"server-spi",
"server-spi-private",
"services"
).map { compileOnly("org.keycloak:keycloak-$it:$kcVersion") }
implementation("com.google.code.gson:gson:$gsonVersion")
implementation("org.apache.kafka:kafka-clients:$kafkaVersion")
// setup to avoid conflict with keycloak production "slf4j" dependency
{ exclude(group = "org.slf4j", module = "slf4j-api") }
// protobuf stuff
implementation("com.google.protobuf:protobuf-java:3.16.3")
implementation("io.confluent:kafka-protobuf-serializer:5.5.1")
{ exclude(group = "org.slf4j", module = "slf4j-api") }
protobuf(files("protobuf/"))
}
protobuf {
protoc {
// The artifact spec for the Protobuf Compiler
artifact = "com.google.protobuf:protoc:3.16.3"
}
generateProtoTasks {
all().forEach { task ->
task.builtins {
kotlin {}
}
}
}
}
tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
// runtime dependency only will be loaded, to avoid bring keycloak dependencies
from(configurations.runtimeClasspath.map { config ->
config.map { if (it.isDirectory) it else zipTree(it) }
})
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(17)
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}