Skip to content

Commit

Permalink
Start using Gradle version catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
dmikurube committed Apr 26, 2024
1 parent 397132f commit d66ee04
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 22 deletions.
47 changes: 30 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id "java"
id "maven-publish"
id "signing"
id "org.embulk.embulk-plugins" version "0.5.5"
alias(libs.plugins.gradle.embulk.plugins)
id "checkstyle"
}

Expand Down Expand Up @@ -34,22 +34,22 @@ java {
}

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

implementation "com.fasterxml.jackson.core:jackson-annotations:2.6.7"
implementation "com.fasterxml.jackson.core:jackson-core:2.6.7"
implementation "com.fasterxml.jackson.core:jackson-databind:2.6.7.5"
implementation "org.embulk:embulk-util-config:0.3.4"
implementation "org.embulk:embulk-util-file:0.1.5"
implementation "org.embulk:embulk-util-json:0.3.0"
implementation "org.embulk:embulk-util-timestamp:0.2.2"

testImplementation "junit:junit:4.13.2"
testImplementation "org.embulk:embulk-spi:0.11"
testImplementation "org.embulk:embulk-core:0.11.0"
testImplementation "org.embulk:embulk-deps:0.11.0"
testImplementation "org.embulk:embulk-junit4:0.11.0"
compileOnly libs.embulk.spi
compileOnly libs.slf4j

implementation libs.embulk.util.config
implementation libs.validation
implementation libs.bundles.jackson

implementation libs.embulk.util.file
implementation libs.embulk.util.json
implementation libs.embulk.util.timestamp

testImplementation libs.junit4
testImplementation libs.embulk.spi
testImplementation libs.embulk.core
testImplementation libs.embulk.deps
testImplementation libs.embulk.junit4
}

embulkPlugin {
Expand All @@ -76,6 +76,19 @@ javadocJar {
}
}

// A safer and strict alternative to: "dependencies" (and "dependencies --write-locks")
//
// This task fails explicitly when the specified dependency is not available.
// In contrast, "dependencies (--write-locks)" does not fail even when a part the dependencies are unavailable.
//
// https://docs.gradle.org/8.7/userguide/dependency_locking.html#generating_and_updating_dependency_locks
task checkDependencies {
notCompatibleWithConfigurationCache("The task \"checkDependencies\" filters configurations at execution time.")
doLast {
configurations.findAll { it.canBeResolved }.each { it.resolve() }
}
}

publishing {
publications {
maven(MavenPublication) {
Expand Down
14 changes: 9 additions & 5 deletions embulk-guess-json/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id "java"
id "maven-publish"
id "signing"
id "org.embulk.embulk-plugins" version "0.5.5"
alias(libs.plugins.gradle.embulk.plugins)
id "checkstyle"
}

Expand Down Expand Up @@ -34,11 +34,15 @@ java {
}

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

implementation "org.embulk:embulk-util-config:0.3.4"
implementation "org.embulk:embulk-util-file:0.1.5"
implementation "org.embulk:embulk-util-json:0.3.0"
implementation libs.embulk.util.config
implementation libs.validation
implementation libs.bundles.jackson

implementation libs.embulk.util.file
implementation libs.embulk.util.json
}

embulkPlugin {
Expand Down
50 changes: 50 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[versions]

gradle-embulk-plugins = "0.7.0"

embulk-spi = "0.11"
slf4j-api = "2.0.7"

embulk-util-config = "0.3.4"
validation-api = "1.1.0.Final"

jackson = "2.6.7"
jackson-databind = "2.6.7.5"

embulk-util-file = "0.1.5"
embulk-util-json = "0.3.0"
embulk-util-timestamp = "0.2.2"

junit4 = "4.13.2"
embulk-core = "0.11.0"

[libraries]

embulk-spi = { group = "org.embulk", name = "embulk-spi", version.ref = "embulk-spi" }
slf4j = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j-api" }
embulk-util-config = { group = "org.embulk", name = "embulk-util-config", version.ref = "embulk-util-config" }
embulk-util-file = { group = "org.embulk", name = "embulk-util-file", version.ref = "embulk-util-file" }
embulk-util-json = { group = "org.embulk", name = "embulk-util-json", version.ref = "embulk-util-json" }
embulk-util-timestamp = { group = "org.embulk", name = "embulk-util-timestamp", version.ref = "embulk-util-timestamp" }
validation = { group = "javax.validation", name = "validation-api", version.ref = "validation-api" }
jackson-annotations = { group = "com.fasterxml.jackson.core", name = "jackson-annotations", version.ref = "jackson" }
jackson-core = { group = "com.fasterxml.jackson.core", name = "jackson-core", version.ref = "jackson" }
jackson-databind = { group = "com.fasterxml.jackson.core", name = "jackson-databind", version.ref = "jackson-databind" }
jackson-datatype-jdk8 = { group = "com.fasterxml.jackson.datatype", name = "jackson-datatype-jdk8", version.ref = "jackson" }
junit4 = { group = "junit", name = "junit", version.ref = "junit4" }
embulk-core = { group = "org.embulk", name = "embulk-core", version.ref = "embulk-core" }
embulk-deps = { group = "org.embulk", name = "embulk-deps", version.ref = "embulk-core" }
embulk-junit4 = { group = "org.embulk", name = "embulk-junit4", version.ref = "embulk-core" }

[bundles]

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

[plugins]

gradle-embulk-plugins = { id = "org.embulk.embulk-plugins", version.ref = "gradle-embulk-plugins" }
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

0 comments on commit d66ee04

Please sign in to comment.