From 1b6e9eab9f3829cf4c6839ae308cc0bc2a90d4f8 Mon Sep 17 00:00:00 2001 From: Dai MIKURUBE Date: Fri, 26 Apr 2024 16:19:43 +0900 Subject: [PATCH] Start using Gradle version catalog --- build.gradle | 26 ++++++++++++++++++++----- gradle/libs.versions.toml | 41 +++++++++++++++++++++++++++++++++++++++ settings-gradle.lockfile | 4 ++++ 3 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 gradle/libs.versions.toml create mode 100644 settings-gradle.lockfile diff --git a/build.gradle b/build.gradle index cf723bbc..0069922b 100644 --- a/build.gradle +++ b/build.gradle @@ -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" } @@ -34,11 +34,14 @@ java { } dependencies { - compileOnly "org.embulk:embulk-spi:0.11" - compileOnly "org.slf4j:slf4j-api:2.0.7" + compileOnly libs.embulk.spi + compileOnly libs.slf4j - implementation "org.embulk:embulk-util-config:0.3.4" - implementation "org.embulk:embulk-util-timestamp:0.2.2" + implementation libs.embulk.util.config + implementation libs.validation + implementation libs.bundles.jackson + + implementation libs.embulk.util.timestamp } embulkPlugin { @@ -65,6 +68,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) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..300081f9 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,41 @@ +[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-timestamp = "0.2.2" + +[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-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" } + +[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" } diff --git a/settings-gradle.lockfile b/settings-gradle.lockfile new file mode 100644 index 00000000..709a43f7 --- /dev/null +++ b/settings-gradle.lockfile @@ -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