Skip to content

Commit

Permalink
Start using Gradle's version catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
dmikurube committed Apr 3, 2024
1 parent 35cb6a5 commit 53b6464
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 28 deletions.
42 changes: 14 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ plugins {
id "checkstyle"
}

ext {
if (!project.hasProperty("jacksonVersionForJacksonTest")) {
jacksonVersionForJacksonTest = "2.15.3"
}
}

repositories {
mavenCentral()
}
Expand Down Expand Up @@ -57,32 +51,27 @@ sourceSets {
}

dependencies {
compileOnly "org.embulk:embulk-spi:0.11"
compileOnly "org.slf4j:slf4j-api:2.0.7"
compileOnly libs.embulk.spi
compileOnly libs.slf4j.api

// Dependencies should be "api" so that their scope would be "compile" in "pom.xml".
api "javax.validation:validation-api:1.1.0.Final"
api platform("com.fasterxml.jackson:jackson-bom:2.15.3")
api "com.fasterxml.jackson.core:jackson-annotations"
api "com.fasterxml.jackson.core:jackson-core"
api "com.fasterxml.jackson.core:jackson-databind"
api "com.fasterxml.jackson.datatype:jackson-datatype-jdk8" // Required for java.util.Optional.
api libs.validation.api

api platform(libs.jackson.bom)
api libs.bundles.jackson

testImplementation "org.junit.jupiter:junit-jupiter-api:5.10.0"
testImplementation "org.junit.jupiter:junit-jupiter-params:5.10.0"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.10.0"
testImplementation platform(libs.junit5.bom)
testImplementation libs.bundles.junit5.implementation
testRuntimeOnly libs.bundles.junit5.runtime

testImplementation "org.embulk:embulk-spi:0.11"
testImplementation libs.embulk.spi

testImplementation "org.apache.bval:bval-jsr303:0.5"
testImplementation "joda-time:joda-time:2.9.2"
testImplementation "ch.qos.logback:logback-classic:1.3.6"

testImplementation platform("com.fasterxml.jackson:jackson-bom:$jacksonVersionForJacksonTest")
testImplementation "com.fasterxml.jackson.core:jackson-annotations"
testImplementation "com.fasterxml.jackson.core:jackson-core"
testImplementation "com.fasterxml.jackson.core:jackson-databind"
testImplementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8" // Required for java.util.Optional.
testImplementation platform(testLibs.jackson.bom)
testImplementation testLibs.bundles.jackson

legacyTestImplementation "junit:junit:4.13.2"

Expand All @@ -91,11 +80,8 @@ dependencies {
legacyTestImplementation "org.embulk:embulk-junit4:0.11.1"
legacyTestImplementation "ch.qos.logback:logback-classic:1.3.6"

legacyTestImplementation platform("com.fasterxml.jackson:jackson-bom:$jacksonVersionForJacksonTest")
legacyTestImplementation "com.fasterxml.jackson.core:jackson-annotations"
legacyTestImplementation "com.fasterxml.jackson.core:jackson-core"
legacyTestImplementation "com.fasterxml.jackson.core:jackson-databind"
legacyTestImplementation "com.fasterxml.jackson.datatype:jackson-datatype-jdk8" // Required for java.util.Optional.
legacyTestImplementation platform(testLibs.jackson.bom)
legacyTestImplementation testLibs.bundles.jackson
}

javadoc {
Expand Down
38 changes: 38 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[versions]
embulk-spi = "0.11"
slf4j-api = "2.0.7"
validation-api = "1.1.0.Final"
jackson = { strictly = "[2.15.3,3[", prefer = "2.15.3" }
junit5 = "5.10.0"

[libraries]
embulk-spi = { group = "org.embulk", name = "embulk-spi", version.ref = "embulk-spi" }
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j-api" }
validation-api = { group = "javax.validation", name = "validation-api", version.ref = "validation-api" }
jackson-bom = { group = "com.fasterxml.jackson", name = "jackson-bom", version.ref = "jackson" }
jackson-annotations = { group = "com.fasterxml.jackson.core", name = "jackson-annotations" }
jackson-core = { group = "com.fasterxml.jackson.core", name = "jackson-core" }
jackson-databind = { group = "com.fasterxml.jackson.core", name = "jackson-databind" }
jackson-datatype-jdk8 = { group = "com.fasterxml.jackson.datatype", name = "jackson-datatype-jdk8" }
junit5-bom = { group = "org.junit", name = "junit-bom", version.ref = "junit5" }
junit5-api = { group = "org.junit.jupiter", name = "junit-jupiter-api" }
junit5-params = { group = "org.junit.jupiter", name = "junit-jupiter-params" }
junit5-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine" }

[bundles]

jackson = [
"jackson-annotations",
"jackson-core",
"jackson-databind",
"jackson-datatype-jdk8",
]

junit5-implementation = [
"junit5-api",
"junit5-params",
]

junit5-runtime = [
"junit5-engine",
]
4 changes: 4 additions & 0 deletions settings-gradle.lockfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This is a Gradle generated file for dependency locking.
# Manual edits can break the build and are not advised.
# This file is expected to be part of source control.
empty=incomingCatalogForLibs0
19 changes: 19 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
rootProject.name = "embulk-util-config"

dependencyResolutionManagement {
versionCatalogs {
testLibs {
def jacksonVersion = version("jackson", providers.gradleProperty("jacksonVersionForJacksonTest").getOrElse("2.15.3"))

library("jackson-bom", "com.fasterxml.jackson", "jackson-bom").versionRef(jacksonVersion)

library("jackson-annotations", "com.fasterxml.jackson.core", "jackson-annotations").withoutVersion()
library("jackson-core", "com.fasterxml.jackson.core", "jackson-core").withoutVersion()
library("jackson-databind", "com.fasterxml.jackson.core", "jackson-databind").withoutVersion()

// Required for java.util.Optional.
library("jackson-datatype-jdk8", "com.fasterxml.jackson.datatype", "jackson-datatype-jdk8").withoutVersion()

bundle("jackson", [ "jackson-annotations", "jackson-core", "jackson-databind", "jackson-datatype-jdk8" ])
}
}
}

0 comments on commit 53b6464

Please sign in to comment.