Skip to content

Commit

Permalink
chore: use gradle's version catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
celcius112 committed Oct 5, 2024
1 parent 2cf9795 commit 5e50de8
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 224 deletions.
22 changes: 6 additions & 16 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ plugins {
base
`maven-publish`
signing
kotlin("jvm") version "2.0.20" apply false
id("org.jlleitschuh.gradle.ktlint") version "12.1.1" apply false
id("io.gitlab.arturbosch.detekt") version "1.23.7"
id("net.researchgate.release") version "3.0.2"
id("se.bjurr.gitchangelog.git-changelog-gradle-plugin") version "2.1.2"
id("org.jetbrains.dokka") version "1.9.20"
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.ktlint) apply false
alias(libs.plugins.detekt)
alias(libs.plugins.release)
alias(libs.plugins.changelog)
alias(libs.plugins.dokka)
}

allprojects {
Expand All @@ -19,16 +19,6 @@ allprojects {
repositories {
mavenCentral()
}

registerProperties(
"commons-io.version" to "2.17.0",
"jsonassert.version" to "1.5.3",
"assertj.version" to "3.26.3",
"hamcrest.version" to "3.0",
"junit-jupiter.version" to "5.11.1",
"assertk-jvm.version" to "0.28.1",
"wiremock.version" to "3.9.1"
)
}

tasks {
Expand Down
137 changes: 0 additions & 137 deletions buildSrc/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions buildSrc/build.gradle.kts

This file was deleted.

13 changes: 0 additions & 13 deletions buildSrc/src/main/kotlin/utils.kt

This file was deleted.

33 changes: 33 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[versions]
changelog = "2.1.2"
detekt = "1.23.7"
dokka = "1.9.20"
kotlin = "2.0.20"
ktlint = "12.1.1"
release = "3.0.2"
assertj = "3.26.3"
assertk = "0.28.1"
commons-io = "2.17.0"
hamcrest = "3.0"
jsonassert = "1.5.3"
junit-jupiter = "5.11.1"
kohttp = "0.12.0"
wiremock = "3.9.1"

[libraries]
assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj" }
assertk = { module = "com.willowtreeapps.assertk:assertk", version.ref = "assertk" }
commons-io = { module = "commons-io:commons-io", version.ref = "commons-io" }
hamcrest = { module = "org.hamcrest:hamcrest", version.ref = "hamcrest" }
jsonassert = { module = "org.skyscreamer:jsonassert", version.ref = "jsonassert" }
junit-jupiter = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit-jupiter" }
kohttp-jackson = { module = "io.github.rybalkinsd:kohttp-jackson", version.ref = "kohttp" }
wiremock = { module = "org.wiremock:wiremock", version.ref = "wiremock" }

[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
release = { id = "net.researchgate.release", version.ref = "release" }
changelog = { id = "se.bjurr.gitchangelog.git-changelog-gradle-plugin", version.ref = "changelog" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
17 changes: 6 additions & 11 deletions jcv-assertj/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,11 @@ dependencies {
implementation(kotlin("stdlib"))

api(project(":jcv-core"))
implementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}")
implementation(group = "org.assertj", name = "assertj-core", version = "${prop("assertj.version")}")
implementation(libs.jsonassert)
implementation(libs.assertj.core)

testImplementation(
group = "org.junit.jupiter",
name = "junit-jupiter",
version = "${prop("junit-jupiter.version")}",
)

testImplementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}")
testImplementation(group = "org.assertj", name = "assertj-core", version = "${prop("assertj.version")}")
testImplementation(group = "commons-io", name = "commons-io", version = "${prop("commons-io.version")}")
testImplementation(libs.junit.jupiter)
testImplementation(libs.jsonassert)
testImplementation(libs.assertj.core)
testImplementation(libs.commons.io)
}
17 changes: 4 additions & 13 deletions jcv-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,11 @@ publishing {
dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("reflect"))
implementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}")
implementation(libs.jsonassert)

testImplementation(
group = "org.junit.jupiter",
name = "junit-jupiter",
version = "${prop("junit-jupiter.version")}",
)

testImplementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}")
testImplementation(
group = "com.willowtreeapps.assertk",
name = "assertk-jvm",
version = "${prop("assertk-jvm.version")}",
) {
testImplementation(libs.junit.jupiter)
testImplementation(libs.jsonassert)
testImplementation(libs.assertk) {
exclude(group = "org.jetbrains.kotlin", module = "kotlin-reflect")
}
}
17 changes: 6 additions & 11 deletions jcv-hamcrest/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,11 @@ publishing {
dependencies {
api(project(":jcv-core"))
implementation(kotlin("stdlib"))
implementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}")
implementation(group = "org.hamcrest", name = "hamcrest", version = "${prop("hamcrest.version")}")
implementation(libs.jsonassert)
implementation(libs.hamcrest)

testImplementation(
group = "org.junit.jupiter",
name = "junit-jupiter",
version = "${prop("junit-jupiter.version")}",
)

testImplementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}")
testImplementation(group = "org.hamcrest", name = "hamcrest", version = "${prop("hamcrest.version")}")
testImplementation(group = "commons-io", name = "commons-io", version = "${prop("commons-io.version")}")
testImplementation(libs.junit.jupiter)
testImplementation(libs.jsonassert)
testImplementation(libs.hamcrest)
testImplementation(libs.commons.io)
}
23 changes: 7 additions & 16 deletions jcv-wiremock/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,14 @@ publishing {
dependencies {
api(project(":jcv-core"))
implementation(kotlin("stdlib"))
implementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}")
implementation(group = "org.wiremock", name = "wiremock", version = "${prop("wiremock.version")}")
implementation(libs.jsonassert)
implementation(libs.wiremock)

testImplementation(
group = "org.junit.jupiter",
name = "junit-jupiter",
version = "${prop("junit-jupiter.version")}",
)

testImplementation(group = "org.skyscreamer", name = "jsonassert", version = "${prop("jsonassert.version")}")
testImplementation(
group = "com.willowtreeapps.assertk",
name = "assertk-jvm",
version = "${prop("assertk-jvm.version")}",
) {
testImplementation(libs.junit.jupiter)
testImplementation(libs.jsonassert)
testImplementation(libs.assertk) {
exclude(group = "org.jetbrains.kotlin", module = "kotlin-reflect")
}
testImplementation(group = "org.wiremock", name = "wiremock", version = "${prop("wiremock.version")}")
testImplementation("io.github.rybalkinsd:kohttp-jackson:0.12.0")
testImplementation(libs.wiremock)
testImplementation(libs.kohttp.jackson)
}

0 comments on commit 5e50de8

Please sign in to comment.