Skip to content

Commit

Permalink
Migrate to Gradle's Version Catalogs
Browse files Browse the repository at this point in the history
  • Loading branch information
gesellix committed Jan 18, 2025
1 parent 6d77ec1 commit 0cb6c78
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 145 deletions.
75 changes: 29 additions & 46 deletions client-groovy4/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,60 +15,46 @@ dependencies {
constraints {
implementation("de.gesellix:docker-engine") {
version {
strictly("[2024-11-06T01-01-01,)")
strictly("[2025-01-01T01-01-01,)")
}
}
implementation("de.gesellix:docker-filesocket") {
version {
strictly("[2024-11-04T01-01-01,)")
strictly("[2025-01-01T01-01-01,)")
}
}
implementation("de.gesellix:docker-remote-api-model-1-41") {
version {
strictly("[2024-11-06T01-01-01,)")
strictly("[2025-01-01T01-01-01,)")
}
}
implementation("org.slf4j:slf4j-api") {
implementation(libs.slf4j) {
version {
strictly("[1.7,3)")
prefer("2.0.16")
strictly(libs.versions.slf4jVersionrange.get())
prefer(libs.versions.slf4j.get())
}
}
implementation("com.squareup.okhttp3:mockwebserver") {
version {
strictly("[4,5)")
prefer("4.12.0")
}
}
api("com.squareup.okhttp3:okhttp") {
version {
strictly("[4,5)")
prefer("4.12.0")
listOf(libs.bundles.okhttp).forEach {
implementation(it) {
version {
strictly(libs.versions.okhttpVersionrange.get())
prefer(libs.versions.okhttp.get())
}
}
}
listOf(
"com.squareup.okio:okio",
"com.squareup.okio:okio-jvm"
).forEach {
listOf(libs.bundles.okio).forEach {
implementation(it) {
version {
strictly("[3,4)")
prefer("3.9.1")
strictly(libs.versions.okioVersionrange.get())
prefer(libs.versions.okio.get())
}
}
}
listOf(
"org.jetbrains.kotlin:kotlin-reflect",
"org.jetbrains.kotlin:kotlin-stdlib",
"org.jetbrains.kotlin:kotlin-stdlib-jdk7",
"org.jetbrains.kotlin:kotlin-stdlib-jdk8",
"org.jetbrains.kotlin:kotlin-stdlib-common",
"org.jetbrains.kotlin:kotlin-test"
).forEach {
listOf(libs.bundles.kotlin).forEach {
implementation(it) {
version {
strictly("[1.6,3)")
prefer("2.1.0")
strictly(libs.versions.kotlinVersionrange.get())
prefer(libs.versions.kotlin.get())
}
}
}
Expand All @@ -83,14 +69,11 @@ dependencies {
}
}
}
listOf(
"com.squareup.moshi:moshi",
"com.squareup.moshi:moshi-kotlin"
).forEach {
listOf(libs.bundles.moshi).forEach {
implementation(it) {
version {
strictly("[1.12.0,)")
prefer("1.15.2")
strictly(libs.versions.moshiVersionrange.get())
prefer(libs.versions.moshi.get())
}
}
}
Expand All @@ -106,21 +89,21 @@ dependencies {
implementation("org.apache.groovy:groovy:4.0.24")
implementation("org.apache.groovy:groovy-json:4.0.24")

api("com.squareup.moshi:moshi:1.15.2")
api(libs.moshi)
implementation("com.google.re2j:re2j:1.8")

implementation("org.slf4j:slf4j-api:2.0.16")
testImplementation("ch.qos.logback:logback-classic:[1.2,2)!!1.3.14")
implementation(libs.slf4j)
testImplementation("ch.qos.logback:logback-classic:${libs.versions.logbackVersionrange.get()}!!${libs.versions.logback.get()}")

implementation("com.squareup.okio:okio:3.9.1")
api("com.squareup.okhttp3:okhttp:4.12.0")
testImplementation("com.squareup.okhttp3:mockwebserver:[4,5)")
implementation(libs.okio)
api(libs.okhttp)
testImplementation("com.squareup.okhttp3:mockwebserver:${libs.versions.okhttp.get()}")

implementation("org.apache.commons:commons-compress:1.27.1")

// implementation("org.bouncycastle:bcpkix-jdk18on:1.76")
// implementation("org.bouncycastle:bcpkix-jdk18on:1.80")

testImplementation("de.gesellix:testutil:[2024-01-01T01-01-01,)")
testImplementation("de.gesellix:testutil:[2025-01-01T01-01-01,)")

testImplementation("org.junit.platform:junit-platform-launcher:1.11.4")
testImplementation("org.spockframework:spock-core:2.3-groovy-4.0")
Expand Down
73 changes: 28 additions & 45 deletions client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,60 +15,46 @@ dependencies {
constraints {
implementation("de.gesellix:docker-engine") {
version {
strictly("[2024-11-06T01-01-01,)")
strictly("[2025-01-01T01-01-01,)")
}
}
implementation("de.gesellix:docker-filesocket") {
version {
strictly("[2024-11-04T01-01-01,)")
strictly("[2025-01-01T01-01-01,)")
}
}
implementation("de.gesellix:docker-remote-api-model-1-41") {
version {
strictly("[2024-11-06T01-01-01,)")
strictly("[2025-01-01T01-01-01,)")
}
}
implementation("org.slf4j:slf4j-api") {
implementation(libs.slf4j) {
version {
strictly("[1.7,3)")
prefer("2.0.16")
strictly(libs.versions.slf4jVersionrange.get())
prefer(libs.versions.slf4j.get())
}
}
implementation("com.squareup.okhttp3:mockwebserver") {
version {
strictly("[4,5)")
prefer("4.12.0")
}
}
api("com.squareup.okhttp3:okhttp") {
version {
strictly("[4,5)")
prefer("4.12.0")
listOf(libs.bundles.okhttp).forEach {
implementation(it) {
version {
strictly(libs.versions.okhttpVersionrange.get())
prefer(libs.versions.okhttp.get())
}
}
}
listOf(
"com.squareup.okio:okio",
"com.squareup.okio:okio-jvm"
).forEach {
listOf(libs.bundles.okio).forEach {
implementation(it) {
version {
strictly("[3,4)")
prefer("3.9.1")
strictly(libs.versions.okioVersionrange.get())
prefer(libs.versions.okio.get())
}
}
}
listOf(
"org.jetbrains.kotlin:kotlin-reflect",
"org.jetbrains.kotlin:kotlin-stdlib",
"org.jetbrains.kotlin:kotlin-stdlib-jdk7",
"org.jetbrains.kotlin:kotlin-stdlib-jdk8",
"org.jetbrains.kotlin:kotlin-stdlib-common",
"org.jetbrains.kotlin:kotlin-test"
).forEach {
listOf(libs.bundles.kotlin).forEach {
implementation(it) {
version {
strictly("[1.6,3)")
prefer("2.1.0")
strictly(libs.versions.kotlinVersionrange.get())
prefer(libs.versions.kotlin.get())
}
}
}
Expand All @@ -83,14 +69,11 @@ dependencies {
}
}
}
listOf(
"com.squareup.moshi:moshi",
"com.squareup.moshi:moshi-kotlin"
).forEach {
listOf(libs.bundles.moshi).forEach {
implementation(it) {
version {
strictly("[1.12.0,)")
prefer("1.15.2")
strictly(libs.versions.moshiVersionrange.get())
prefer(libs.versions.moshi.get())
}
}
}
Expand All @@ -106,21 +89,21 @@ dependencies {
implementation("org.codehaus.groovy:groovy:3.0.23")
implementation("org.codehaus.groovy:groovy-json:3.0.23")

api("com.squareup.moshi:moshi:1.15.2")
api(libs.moshi)
implementation("com.google.re2j:re2j:1.8")

implementation("org.slf4j:slf4j-api:2.0.16")
testImplementation("ch.qos.logback:logback-classic:[1.2,2)!!1.3.14")
implementation(libs.slf4j)
testImplementation("ch.qos.logback:logback-classic:${libs.versions.logbackVersionrange.get()}!!${libs.versions.logback.get()}")

implementation("com.squareup.okio:okio:3.9.1")
api("com.squareup.okhttp3:okhttp:4.12.0")
testImplementation("com.squareup.okhttp3:mockwebserver:[4,5)")
implementation(libs.okio)
api(libs.okhttp)
testImplementation("com.squareup.okhttp3:mockwebserver:${libs.versions.okhttp.get()}")

implementation("org.apache.commons:commons-compress:1.27.1")

implementation("org.bouncycastle:bcpkix-jdk18on:1.80")

testImplementation("de.gesellix:testutil:[2024-01-01T01-01-01,)")
testImplementation("de.gesellix:testutil:[2025-01-01T01-01-01,)")

testImplementation("org.junit.platform:junit-platform-launcher:1.11.4")
testImplementation("org.spockframework:spock-core:2.3-groovy-3.0")
Expand Down
29 changes: 11 additions & 18 deletions explore/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,22 @@ java {

dependencies {
constraints {
implementation("org.slf4j:slf4j-api") {
implementation(libs.slf4j) {
version {
strictly("[1.7,3)")
prefer("2.0.16")
strictly(libs.versions.slf4jVersionrange.get())
prefer(libs.versions.slf4j.get())
}
}
implementation("com.squareup.okio:okio") {
implementation(libs.okio) {
version {
strictly("[3,4)")
strictly(libs.versions.okioVersionrange.get())
}
}
listOf(
"org.jetbrains.kotlin:kotlin-reflect",
"org.jetbrains.kotlin:kotlin-stdlib",
"org.jetbrains.kotlin:kotlin-stdlib-jdk7",
"org.jetbrains.kotlin:kotlin-stdlib-jdk8",
"org.jetbrains.kotlin:kotlin-stdlib-common",
"org.jetbrains.kotlin:kotlin-test"
).forEach {
listOf(libs.bundles.kotlin).forEach {
implementation(it) {
version {
strictly("[1.6,3)")
prefer("2.1.0")
strictly(libs.versions.kotlinVersionrange.get())
prefer(libs.versions.kotlin.get())
}
}
}
Expand Down Expand Up @@ -66,13 +59,13 @@ dependencies {
implementation("org.apache.groovy:groovy:4.0.24")
testImplementation("org.apache.commons:commons-compress:1.27.1")

implementation("org.slf4j:slf4j-api:2.0.16")
runtimeOnly("ch.qos.logback:logback-classic:[1.2,2)!!1.3.14")
implementation(libs.slf4j)
runtimeOnly("ch.qos.logback:logback-classic:${libs.versions.logbackVersionrange.get()}!!${libs.versions.logback.get()}")

// testImplementation("org.spockframework:spock-core:2.3-groovy-3.0")
testImplementation("org.spockframework:spock-core:2.3-groovy-4.0")
testRuntimeOnly("net.bytebuddy:byte-buddy:1.16.0")
testRuntimeOnly("ch.qos.logback:logback-classic:[1.2,2)!!1.3.14")
testRuntimeOnly("ch.qos.logback:logback-classic:${libs.versions.logbackVersionrange.get()}!!${libs.versions.logback.get()}")
}

tasks {
Expand Down
46 changes: 46 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[versions]
junitJupiter = "5.11.4"
junitPlatform = "1.11.4"
kotlin = "2.1.0"
kotlinVersionrange = "[1.6,3)"
logback = "1.3.15"
logbackVersionrange = "[1.2,2)"
moshi = "1.15.2"
moshiVersionrange = "[1.12.0,2)"
okhttp = "4.12.0"
okhttpVersionrange = "[4,5)"
okio = "3.10.2"
okioVersionrange = "[3,4)"
slf4j = "2.0.16"
slf4jVersionrange = "[1.7,3)"

[libraries]
junitJupiterApi = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junitJupiter" }
junitJupiterEngine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junitJupiter" }
junitPlatformCommons = { module = "org.junit.platform:junit-platform-commons", version.ref = "junitPlatform" }
junitPlatformLauncher = { module = "org.junit.platform:junit-platform-launcher", version.ref = "junitPlatform" }
kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlinCommon = { module = "org.jetbrains.kotlin:kotlin-stdlib-common", version.ref = "kotlin" }
kotlinJdk7 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk7", version.ref = "kotlin" }
kotlinJdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlinReflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kotlinScriptingJvm = { module = "org.jetbrains.kotlin:kotlin-scripting-jvm", version.ref = "kotlin" }
kotlinStdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlinTest = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
moshi = { module = "com.squareup.moshi:moshi", version.ref = "moshi" }
moshiKotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "moshi" }
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
okhttpMockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" }
okio = { module = "com.squareup.okio:okio", version.ref = "okio" }
okioJvm = { module = "com.squareup.okio:okio-jvm", version.ref = "okio" }
slf4j = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }

[bundles]
kotlin = ["kotlin", "kotlinCommon", "kotlinJdk7", "kotlinJdk8", "kotlinReflect", "kotlinScriptingJvm", "kotlinStdlib", "kotlinTest"]
moshi = ["moshi", "moshiKotlin"]
okhttp = ["okhttp", "okhttpMockwebserver"]
okio = ["okio", "okioJvm"]

[plugins]
kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
Loading

0 comments on commit 0cb6c78

Please sign in to comment.