Skip to content

Commit aa6dfc0

Browse files
committed
chore: add version catalog
Adds a version catalog to the project to centralize all version definitions and avoid duplicates, see: https://docs.gradle.org/current/userguide/version_catalogs.html
1 parent 7e8fff9 commit aa6dfc0

File tree

2 files changed

+76
-25
lines changed

2 files changed

+76
-25
lines changed

build.gradle.kts

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import org.jlleitschuh.gradle.ktlint.reporter.ReporterType.PLAIN
22
import java.util.Properties
33

44
plugins {
5-
kotlin("jvm") version "2.2.21"
6-
kotlin("plugin.spring") version "2.2.21"
7-
id("org.springframework.boot") version "3.5.7"
8-
id("io.spring.dependency-management") version "1.1.7"
9-
id("dev.detekt") version ("2.0.0-alpha.1")
10-
id("org.jlleitschuh.gradle.ktlint") version "14.0.1"
11-
id("org.jetbrains.kotlinx.kover") version "0.9.3"
12-
id("com.github.ben-manes.versions") version "0.53.0"
5+
alias(libs.plugins.kotlin.jvm)
6+
alias(libs.plugins.kotlin.spring)
7+
alias(libs.plugins.spring.boot)
8+
alias(libs.plugins.spring.dependency.management)
9+
alias(libs.plugins.detekt)
10+
alias(libs.plugins.ktlint)
11+
alias(libs.plugins.kover)
12+
alias(libs.plugins.versions)
1313
}
1414

1515
group = "ch.srgssr.pillarbox"
@@ -26,23 +26,23 @@ repositories {
2626

2727
dependencies {
2828
// Dependencies
29-
implementation("org.springframework.boot:spring-boot-starter-json")
30-
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
31-
implementation("org.jetbrains.kotlin:kotlin-reflect")
32-
implementation("nl.basjes.parse.useragent:yauaa:7.32.0")
33-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core")
34-
implementation("io.ktor:ktor-client-core:3.3.2")
35-
implementation("io.ktor:ktor-client-cio:3.3.2")
29+
implementation(libs.spring.boot.starter.json)
30+
implementation(libs.jackson.module.kotlin)
31+
implementation(libs.kotlin.reflect)
32+
implementation(libs.yauaa)
33+
implementation(libs.kotlin.coroutines.core)
34+
implementation(libs.ktor.client.core)
35+
implementation(libs.ktor.client.cio)
3636

3737
// Test Dependencies
38-
testImplementation("io.kotest:kotest-runner-junit5:5.9.1")
39-
testImplementation("org.springframework.boot:spring-boot-starter-test")
40-
testImplementation("io.kotest.extensions:kotest-extensions-spring:1.3.0")
41-
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
42-
testImplementation("io.mockk:mockk:1.14.6")
43-
testImplementation("com.squareup.okhttp3:mockwebserver:5.3.1")
44-
testImplementation("com.squareup.okhttp3:okhttp:5.3.1")
45-
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
38+
testImplementation(libs.kotest.runner.junit5)
39+
testImplementation(libs.spring.boot.starter.test)
40+
testImplementation(libs.kotest.extensions.spring)
41+
testImplementation(libs.kotlin.test.junit5)
42+
testImplementation(libs.mockk)
43+
testImplementation(libs.mockwebserver)
44+
testImplementation(libs.okhttp)
45+
testRuntimeOnly(libs.junit.platform.launcher)
4646
}
4747

4848
kotlin {
@@ -52,14 +52,17 @@ kotlin {
5252
}
5353

5454
detekt {
55-
toolVersion = "2.0.0-alpha.1"
55+
toolVersion = libs.versions.detekt.get()
5656
buildUponDefaultConfig = true
5757
allRules = false
5858
config.setFrom("$projectDir/detekt.yml")
5959
}
6060

6161
ktlint {
62-
version.set("1.8.0")
62+
version.set(
63+
libs.versions.ktlint.cli
64+
.get(),
65+
)
6366
debug.set(false)
6467
android.set(false)
6568
outputToConsole.set(true)

gradle/libs.versions.toml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[versions]
2+
#Plugins
3+
kotlin = "2.2.21"
4+
spring-boot = "3.5.7"
5+
spring-deps = "1.1.7"
6+
detekt = "2.0.0-alpha.1"
7+
ktlint = "14.0.1"
8+
ktlint-cli = "1.8.0"
9+
kover = "0.9.3"
10+
versions-plugin = "0.53.0"
11+
12+
# Libs
13+
yauaa = "7.32.0"
14+
ktor = "3.3.2"
15+
kotest = "5.9.1"
16+
kotest-spring = "1.3.0"
17+
mockk = "1.14.6"
18+
okhttp = "5.3.1"
19+
20+
[libraries]
21+
22+
spring-boot-starter-json = { module = "org.springframework.boot:spring-boot-starter-json" }
23+
spring-boot-starter-test = { module = "org.springframework.boot:spring-boot-starter-test" }
24+
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect" }
25+
kotlin-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core"}
26+
jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin" }
27+
yauaa = { module = "nl.basjes.parse.useragent:yauaa", version.ref = "yauaa" }
28+
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
29+
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
30+
31+
# Tests
32+
kotest-runner-junit5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" }
33+
kotest-extensions-spring = { module = "io.kotest.extensions:kotest-extensions-spring", version.ref = "kotest-spring" }
34+
kotlin-test-junit5 = { module = "org.jetbrains.kotlin:kotlin-test-junit5" }
35+
mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
36+
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
37+
mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" }
38+
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher" }
39+
40+
[plugins]
41+
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
42+
kotlin-spring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" }
43+
spring-boot = { id = "org.springframework.boot", version.ref = "spring-boot" }
44+
spring-dependency-management = { id = "io.spring.dependency-management", version.ref = "spring-deps" }
45+
detekt = { id = "dev.detekt", version.ref = "detekt" }
46+
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
47+
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
48+
versions = { id = "com.github.ben-manes.versions", version.ref = "versions-plugin" }

0 commit comments

Comments
 (0)