Skip to content

Commit

Permalink
Merge pull request #75 from embulk/gradle-version-catalog
Browse files Browse the repository at this point in the history
Start using Gradle's version catalog
  • Loading branch information
dmikurube authored Apr 17, 2024
2 parents fe75ec2 + 79c81d8 commit 8c4efd8
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
19 changes: 16 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ sourceSets {
}

dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api:5.9.2"
testImplementation "org.junit.jupiter:junit-jupiter-params:5.9.2"
testImplementation platform(libs.junit5.bom)
testImplementation libs.bundles.junit5.implementation

testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.9.2"
testRuntimeOnly libs.bundles.junit5.runtime

jruby9_1_15TestImplementation "org.jruby:jruby-complete:9.1.15.0"
jruby9_1_17TestImplementation "org.jruby:jruby-complete:9.1.17.0"
Expand Down Expand Up @@ -160,6 +160,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() }
}
}

// It should not publish a `.module` file in Maven Central.
// https://docs.gradle.org/current/userguide/publishing_gradle_module_metadata.html#sub:disabling-gmm-publication
tasks.withType(GenerateModuleMetadata) {
Expand Down
21 changes: 21 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[versions]

junit5 = "5.9.2"

[libraries]

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

0 comments on commit 8c4efd8

Please sign in to comment.