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 15, 2024
1 parent 793931c commit e581e96
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 15 deletions.
29 changes: 14 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,22 @@ java {
}

dependencies {
compileOnly "org.embulk:embulk-spi:0.11"
compileOnly "org.msgpack:msgpack-core:0.8.24"
compileOnly libs.embulk.spi
compileOnly libs.msgpack

// Dependencies should be "api" so that their scope would be "compile" in "pom.xml".
api platform("com.fasterxml.jackson:jackson-bom:2.15.3")
api "com.fasterxml.jackson.core:jackson-core"
api platform(libs.jackson.bom)
api libs.jackson.core

testImplementation "org.embulk:embulk-spi:0.11"
testImplementation "org.msgpack:msgpack-core:0.8.24"
testImplementation libs.embulk.spi
testImplementation libs.msgpack

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

testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.9.3"

testImplementation platform("com.fasterxml.jackson:jackson-bom:$jacksonVersionForJacksonTest")
testImplementation "com.fasterxml.jackson.core:jackson-core"
testImplementation platform(testLibs.jackson.bom)
testImplementation testLibs.jackson.core
}

javadoc {
Expand All @@ -67,9 +66,9 @@ javadoc {
encoding = "UTF-8"
overview = "src/main/html/overview.html"
links "https://docs.oracle.com/javase/8/docs/api/"
links "https://dev.embulk.org/embulk-spi/0.11/javadoc/"
links "https://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/2.15.3/"
links "https://javadoc.io/doc/org.msgpack/msgpack-core/0.8.24/"
links "https://dev.embulk.org/embulk-spi/${libs.versions.embulk.spi.get()}/javadoc/"
links "https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-core/${libs.versions.jackson.get()}/"
links "https://javadoc.io/doc/org.msgpack/msgpack-core/${libs.versions.jackson.get()}/"
}
}

Expand Down
40 changes: 40 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[versions]
embulk-spi = "0.11"
msgpack = "0.8.24"

# See https://github.com/FasterXML/jackson/wiki/Jackson-Releases for Jackson versions.
#
# We choose Jackson versions :
# - require: the latest patch release of the oldest (non-nominally) open branch
# - prefer: the latest patch release of the latest open branch
#
# It has required at least Jackson 2.15.3, especially since embulk-util-config 0.4.0.
# It is to align with the restriction of embulk-util-json: https://github.com/embulk/embulk-util-json/pull/37
jackson = "2.15.3"

junit5 = "5.9.3"
embulk-core = "0.11.1"
bval-jsr303 = "0.5"
logback = "1.3.6"
joda-time = "2.9.2"

[libraries]
embulk-spi = { group = "org.embulk", name = "embulk-spi", version.ref = "embulk-spi" }
msgpack = { group = "org.msgpack", name = "msgpack-core", version.ref = "msgpack" }
jackson-bom = { group = "com.fasterxml.jackson", name = "jackson-bom", version.ref = "jackson" }
jackson-core = { group = "com.fasterxml.jackson.core", name = "jackson-core" }
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]

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
12 changes: 12 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
rootProject.name = "embulk-util-json"

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-core", "com.fasterxml.jackson.core", "jackson-core").withoutVersion()
}
}
}

0 comments on commit e581e96

Please sign in to comment.