diff --git a/build.gradle.kts b/build.gradle.kts index df9a318..f675dc9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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" @@ -17,7 +7,6 @@ allprojects { } extra["releaseVersion"] = !version.toString().endsWith("-SNAPSHOT") - extra["versions"] = versions } subprojects { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..5a137eb --- /dev/null +++ b/gradle/libs.versions.toml @@ -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" } diff --git a/hc5-async-json/build.gradle.kts b/hc5-async-json/build.gradle.kts index cb70f8b..a9b3464 100644 --- a/hc5-async-json/build.gradle.kts +++ b/hc5-async-json/build.gradle.kts @@ -12,19 +12,18 @@ java { withSourcesJar() } -val versions: Map 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") {