Skip to content

Commit

Permalink
Upgraded dependency declaration to Gradle Version Catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
ok2c committed Nov 21, 2023
1 parent 632b83d commit 2e7d877
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 21 deletions.
11 changes: 0 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
val versions = mapOf(
"httpcore" to "5.2.3",
"httpclient" to "5.2.1",
"jackson" to "2.16.0",
"slf4j" to "1.7.36",
"junit-jupiter" to "5.8.2",
"mockito" to "4.5.1",
"assertj" to "3.22.0"
)

allprojects {
group = "com.github.ok2c.hc5"
version = "0.3.1-SNAPSHOT"
Expand All @@ -17,7 +7,6 @@ allprojects {
}

extra["releaseVersion"] = !version.toString().endsWith("-SNAPSHOT")
extra["versions"] = versions
}

subprojects {
Expand Down
20 changes: 20 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[versions]
httpcore = "5.2.3"
jackson = "2.16.0"
httpclient = "5.2.1"
slf4j = "1.7.36"
junit = "5.8.2"
mockito = "4.5.1"
assertj = "3.22.0"


[libraries]
httpcore = { group = "org.apache.httpcomponents.core5", name = "httpcore5", version.ref = "httpcore" }
httpcore-h2 = { group = "org.apache.httpcomponents.core5", name = "httpcore5-h2", version.ref = "httpcore" }
jackson-databind = { group = "com.fasterxml.jackson.core", name = "jackson-databind", version.ref = "jackson" }
httpclient = { group = "org.apache.httpcomponents.client5", name = "httpclient5", version.ref = "httpclient" }
slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }
junit-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit" }
junit-params = { group = "org.junit.jupiter", name = "junit-jupiter-params", version.ref = "junit" }
assertj-core = { group = "org.assertj", name = "assertj-core", version.ref = "assertj" }
mockito = { group = "org.mockito", name = "mockito-inline", version.ref = "mockito" }
19 changes: 9 additions & 10 deletions hc5-async-json/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@ java {
withSourcesJar()
}

val versions: Map<String, String> by project.extra
val releaseVersion: Boolean by project.extra

dependencies {
api("org.apache.httpcomponents.core5:httpcore5:${versions["httpcore"]}")
api("org.apache.httpcomponents.core5:httpcore5-h2:${versions["httpcore"]}")
api("com.fasterxml.jackson.core:jackson-databind:${versions["jackson"]}")
testImplementation("org.apache.httpcomponents.client5:httpclient5:${versions["httpclient"]}")
testImplementation("org.junit.jupiter:junit-jupiter-engine:${versions["junit-jupiter"]}")
testImplementation("org.junit.jupiter:junit-jupiter-params:${versions["junit-jupiter"]}")
testImplementation("org.assertj:assertj-core:${versions["assertj"]}")
testImplementation("org.slf4j:slf4j-simple:${versions["slf4j"]}")
testImplementation("org.mockito:mockito-inline:${versions["mockito"]}")
api(libs.httpcore)
api(libs.httpcore.h2)
api(libs.jackson.databind)
testImplementation(libs.httpclient)
testImplementation(libs.slf4j.simple)
testImplementation(libs.junit.engine)
testImplementation(libs.junit.params)
testImplementation(libs.mockito)
testImplementation(libs.assertj.core)
}

tasks.named<Test>("test") {
Expand Down

0 comments on commit 2e7d877

Please sign in to comment.