From 3cf6bfb56eeb19638c52f44f2feb80184afc0717 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 3 May 2025 23:26:35 +0000 Subject: [PATCH 1/2] Implement Gradle version catalog for dependency management Co-Authored-By: Toshihiro Nakamura --- build.gradle.kts | 31 +++++++++++++++---------------- gradle.properties | 1 - gradle/libs.versions.toml | 29 +++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 gradle/libs.versions.toml diff --git a/build.gradle.kts b/build.gradle.kts index 44eaa29a..16c90d5c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,17 +5,17 @@ buildscript { mavenCentral() } dependencies { - classpath("com.h2database:h2:1.4.200") + classpath(libs.jdbc.h2) } } plugins { id("application") - id("com.diffplug.spotless") version "7.0.3" - id("org.domaframework.doma.codegen") version "3.0.0" - id("org.domaframework.doma.compile") version "3.0.1" - kotlin("jvm") version "2.1.20" - kotlin("kapt") version "2.1.20" + alias(libs.plugins.spotless) + alias(libs.plugins.doma.codegen) + alias(libs.plugins.doma.compile) + alias(libs.plugins.kotlin.jvm) + alias(libs.plugins.kotlin.kapt) } kotlin { @@ -28,17 +28,16 @@ application { } dependencies { - val domaVersion: String by project - kapt("org.seasar.doma:doma-processor:$domaVersion") - implementation("org.seasar.doma:doma-kotlin:$domaVersion") - implementation("org.seasar.doma:doma-slf4j:$domaVersion") - runtimeOnly("ch.qos.logback:logback-classic:1.5.18") - runtimeOnly("com.h2database:h2:1.4.200") + kapt(libs.doma.processor) + implementation(libs.doma.kotlin) + implementation(libs.doma.slf4j) + runtimeOnly(libs.logback.classic) + runtimeOnly(libs.jdbc.h2) // Use JUnit BOM for version management - testImplementation(platform("org.junit:junit-bom:5.12.2")) - testImplementation("org.junit.jupiter:junit-jupiter-api") - testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine") - testRuntimeOnly("org.junit.platform:junit-platform-launcher") + testImplementation(platform(libs.junit.bom)) + testImplementation(libs.junit.jupiter.api) + testRuntimeOnly(libs.junit.jupiter.engine) + testRuntimeOnly(libs.junit.platform.launcher) } repositories { diff --git a/gradle.properties b/gradle.properties index 56647593..78012b18 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,3 @@ -domaVersion=3.7.0 kapt.incremental.apt=true kapt.use.worker.api=true kapt.include.compile.classpath=false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..df953520 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,29 @@ +[versions] +doma = "3.7.0" +kotlin = "2.1.20" +junit = "5.12.2" +spotless = "7.0.3" +doma-codegen = "3.0.0" +doma-compile = "3.0.1" +h2 = "1.4.200" +logback = "1.5.18" + +[libraries] +doma-processor = { module = "org.seasar.doma:doma-processor", version.ref = "doma" } +doma-kotlin = { module = "org.seasar.doma:doma-kotlin", version.ref = "doma" } +doma-slf4j = { module = "org.seasar.doma:doma-slf4j", version.ref = "doma" } + +logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" } +jdbc-h2 = { module = "com.h2database:h2", version.ref = "h2" } + +junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" } +junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api" } +junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine" } +junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher" } + +[plugins] +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } +spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } +doma-codegen = { id = "org.domaframework.doma.codegen", version.ref = "doma-codegen" } +doma-compile = { id = "org.domaframework.doma.compile", version.ref = "doma-compile" } From 6b156874ec13e456fea4c4078fe71c2c121e2312 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 3 May 2025 23:33:27 +0000 Subject: [PATCH 2/2] Add ktlint version to version catalog Co-Authored-By: Toshihiro Nakamura --- build.gradle.kts | 2 +- gradle/libs.versions.toml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 16c90d5c..7ff25524 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -48,7 +48,7 @@ repositories { spotless { kotlin { - ktlint("1.1.1") + ktlint(libs.versions.ktlint.get()) trimTrailingWhitespace() endWithNewline() } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index df953520..d892825d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -7,6 +7,7 @@ doma-codegen = "3.0.0" doma-compile = "3.0.1" h2 = "1.4.200" logback = "1.5.18" +ktlint = "1.1.1" [libraries] doma-processor = { module = "org.seasar.doma:doma-processor", version.ref = "doma" }