-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
109 lines (93 loc) · 3.05 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
105
106
107
108
109
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType.PLAIN
import java.util.Properties
plugins {
kotlin("jvm") version "2.0.10"
kotlin("plugin.spring") version "2.0.10"
id("org.springframework.boot") version "3.3.4"
id("io.spring.dependency-management") version "1.1.6"
id("io.gitlab.arturbosch.detekt") version "1.23.7"
id("org.jlleitschuh.gradle.ktlint") version "12.1.1"
id("org.jetbrains.kotlinx.kover") version "0.8.3"
}
group = "ch.srgssr.pillarbox"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(22)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-aop")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.opensearch.client:spring-data-opensearch-starter:1.5.3")
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
implementation("com.github.ben-manes.caffeine:caffeine")
implementation("nl.basjes.parse.useragent:yauaa:7.28.1")
testImplementation("io.kotest:kotest-runner-junit5:5.9.1")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.kotest.extensions:kotest-extensions-spring:1.3.0")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testImplementation("io.mockk:mockk:1.13.13")
testImplementation("com.squareup.okhttp3:mockwebserver")
testImplementation("com.squareup.okhttp3:okhttp")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict")
}
}
detekt {
toolVersion = "1.23.7"
buildUponDefaultConfig = true
allRules = false
config.setFrom("$projectDir/detekt.yml")
}
ktlint {
version.set("1.3.1")
debug.set(false)
android.set(false)
outputToConsole.set(true)
ignoreFailures.set(false)
enableExperimentalRules.set(true)
reporters {
reporter(PLAIN)
}
}
tasks.jar.configure {
enabled = false
}
tasks.bootJar.configure {
val archiveFileName =
archiveBaseName.zip(archiveExtension) { baseName, extension ->
"$baseName.$extension"
}
this.archiveFileName.set(archiveFileName)
layered { enabled = true }
}
tasks.withType<Test> {
useJUnitPlatform()
finalizedBy("koverXmlReport")
}
val updateVersion by tasks.registering {
doLast {
val version = project.findProperty("version")?.toString()
val propertiesFile = file("gradle.properties")
val properties = Properties()
propertiesFile.inputStream().use { properties.load(it) }
if (properties.get("version") != version) {
properties.setProperty("version", version)
propertiesFile.outputStream().use { properties.store(it, null) }
println("Version updated to $version in gradle.properties")
}
}
}
tasks.register("release") {
dependsOn("build", updateVersion)
}