-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
93 lines (80 loc) · 2.12 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
import kotlin.io.path.createDirectories
import kotlin.io.path.notExists
plugins {
alias(libs.plugins.spring)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.spring)
alias(libs.plugins.shadow) // alias(libs.plugins.vaadin)
application
}
group = "de.dasbabypixel"
version = "0.1.0"
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("reflect"))
implementation(libs.bundles.logging)
implementation(libs.gson)
implementation(libs.hikaricp)
implementation(libs.mysql.connector.j)
implementation(libs.bundles.spring) {
exclude("org.apache.logging.log4j", "log4j-to-slf4j")
exclude("ch.qos.logback", "logback-classic")
}
implementation(libs.spring.boot.starter.webflux) {
exclude("org.apache.logging.log4j", "log4j-to-slf4j")
exclude("ch.qos.logback", "logback-classic")
}
testImplementation(kotlin("test"))
testImplementation("org.mockito:mockito-core:5.15.2")
developmentOnly(libs.spring.boot.devtools)
}
gradle.taskGraph.whenReady {
allTasks.filterIsInstance<JavaExec>().forEach {
it.setExecutable(it.javaLauncher.get().executablePath.asFile.absolutePath)
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
val createRunDir = tasks.register("createRunDir") {
val dir = projectDir.resolve("run").toPath()
doFirst {
if (dir.notExists()) {
dir.createDirectories()
}
}
}
tasks {
withType<Test>().configureEach {
useJUnitPlatform()
}
assemble.configure {
dependsOn(shadowJar)
}
test {
if (project.hasProperty("CI")) {
exclude("**/SQLDatabaseTest.class")
}
}
}
tasks.withType<JavaExec>().configureEach {
javaLauncher = javaToolchains.launcherFor(java.toolchain)
standardInput = System.`in`
standardOutput = System.out
errorOutput = System.err
}
kotlin {
jvmToolchain(21)
}
tasks.bootRun.configure {
dependsOn(createRunDir)
workingDir("run")
jvmArgs("-Dserver.port=4242")
}
application {
mainClass = "de.dasbabypixel.heating.MainKt"
}