This repository has been archived by the owner on Jan 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
59 lines (49 loc) · 1.48 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.8.21"
application
}
group = "dev.piotrp"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
testImplementation(kotlin("test"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1")
implementation("org.apache.kafka:kafka-clients:3.5.0")
implementation("org.slf4j:slf4j-simple:2.0.7")
implementation("org.jetbrains.kotlinx:kotlinx-cli:0.3.5")
implementation("com.sksamuel.hoplite:hoplite-yaml:2.7.4")
implementation("com.sksamuel.hoplite:hoplite-core:2.7.4")
implementation("org.postgresql:postgresql:42.6.0")
}
tasks.test {
useJUnitPlatform()
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(11))
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
}
}
application {
mainClass.set("MainKt")
}
tasks.jar {
manifest.attributes["Main-Class"] = "MainKt"
// for building a fat jar - include all dependencies
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
}) {
// https://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar
exclude("META-INF/*.SF")
exclude("META-INF/*.DSA")
exclude("META-INF/*.RSA")
}
}