Skip to content

Commit 3cf6bfb

Browse files
Implement Gradle version catalog for dependency management
Co-Authored-By: Toshihiro Nakamura <[email protected]>
1 parent d41a0c9 commit 3cf6bfb

File tree

3 files changed

+44
-17
lines changed

3 files changed

+44
-17
lines changed

build.gradle.kts

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ buildscript {
55
mavenCentral()
66
}
77
dependencies {
8-
classpath("com.h2database:h2:1.4.200")
8+
classpath(libs.jdbc.h2)
99
}
1010
}
1111

1212
plugins {
1313
id("application")
14-
id("com.diffplug.spotless") version "7.0.3"
15-
id("org.domaframework.doma.codegen") version "3.0.0"
16-
id("org.domaframework.doma.compile") version "3.0.1"
17-
kotlin("jvm") version "2.1.20"
18-
kotlin("kapt") version "2.1.20"
14+
alias(libs.plugins.spotless)
15+
alias(libs.plugins.doma.codegen)
16+
alias(libs.plugins.doma.compile)
17+
alias(libs.plugins.kotlin.jvm)
18+
alias(libs.plugins.kotlin.kapt)
1919
}
2020

2121
kotlin {
@@ -28,17 +28,16 @@ application {
2828
}
2929

3030
dependencies {
31-
val domaVersion: String by project
32-
kapt("org.seasar.doma:doma-processor:$domaVersion")
33-
implementation("org.seasar.doma:doma-kotlin:$domaVersion")
34-
implementation("org.seasar.doma:doma-slf4j:$domaVersion")
35-
runtimeOnly("ch.qos.logback:logback-classic:1.5.18")
36-
runtimeOnly("com.h2database:h2:1.4.200")
31+
kapt(libs.doma.processor)
32+
implementation(libs.doma.kotlin)
33+
implementation(libs.doma.slf4j)
34+
runtimeOnly(libs.logback.classic)
35+
runtimeOnly(libs.jdbc.h2)
3736
// Use JUnit BOM for version management
38-
testImplementation(platform("org.junit:junit-bom:5.12.2"))
39-
testImplementation("org.junit.jupiter:junit-jupiter-api")
40-
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
41-
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
37+
testImplementation(platform(libs.junit.bom))
38+
testImplementation(libs.junit.jupiter.api)
39+
testRuntimeOnly(libs.junit.jupiter.engine)
40+
testRuntimeOnly(libs.junit.platform.launcher)
4241
}
4342

4443
repositories {

gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
domaVersion=3.7.0
21
kapt.incremental.apt=true
32
kapt.use.worker.api=true
43
kapt.include.compile.classpath=false

gradle/libs.versions.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[versions]
2+
doma = "3.7.0"
3+
kotlin = "2.1.20"
4+
junit = "5.12.2"
5+
spotless = "7.0.3"
6+
doma-codegen = "3.0.0"
7+
doma-compile = "3.0.1"
8+
h2 = "1.4.200"
9+
logback = "1.5.18"
10+
11+
[libraries]
12+
doma-processor = { module = "org.seasar.doma:doma-processor", version.ref = "doma" }
13+
doma-kotlin = { module = "org.seasar.doma:doma-kotlin", version.ref = "doma" }
14+
doma-slf4j = { module = "org.seasar.doma:doma-slf4j", version.ref = "doma" }
15+
16+
logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
17+
jdbc-h2 = { module = "com.h2database:h2", version.ref = "h2" }
18+
19+
junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" }
20+
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api" }
21+
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine" }
22+
junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher" }
23+
24+
[plugins]
25+
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
26+
kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
27+
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
28+
doma-codegen = { id = "org.domaframework.doma.codegen", version.ref = "doma-codegen" }
29+
doma-compile = { id = "org.domaframework.doma.compile", version.ref = "doma-compile" }

0 commit comments

Comments
 (0)