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 11, 2025
1 parent 28c97e3 commit bd3c35d
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 47 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ plugins {
val dependencyVersions = listOf(
"org.apache.commons:commons-lang3:3.17.0",
"org.jetbrains:annotations:26.0.1",
"junit:junit:4.13.2"
libs.junit4,
)

val dependencyGroupVersions = mapOf<String, String>(
Expand Down
43 changes: 18 additions & 25 deletions engine/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,63 +18,56 @@ dependencies {
constraints {
implementation("org.slf4j:slf4j-api") {
version {
strictly("[1.7,3)")
prefer("2.0.16")
strictly(libs.versions.slf4jVersionrange.get())
prefer(libs.versions.slf4j.get())
}
}
implementation("com.squareup.moshi:moshi") {
version {
strictly("[1.12.0,2)")
prefer("1.15.2")
strictly(libs.versions.moshiVersionrange.get())
prefer(libs.versions.moshi.get())
}
}
listOf(
"com.squareup.okhttp3:mockwebserver",
"com.squareup.okhttp3:okhttp"
).forEach {
implementation(it) {
version {
strictly("[4,5)")
prefer("4.12.0")
strictly(libs.versions.okhttpVersionrange.get())
prefer(libs.versions.okhttp.get())
}
}
}
listOf(
"com.squareup.okio:okio",
"com.squareup.okio:okio-jvm"
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"
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())
}
}
}
}

implementation("com.squareup.moshi:moshi:1.15.2")
implementation(libs.moshi)

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")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
testImplementation("com.squareup.okhttp3:mockwebserver:4.12.0")
implementation(libs.okio)
implementation(libs.okhttp)
testImplementation(libs.okhttpMockwebserver)

implementation("org.apache.commons:commons-compress:1.27.1")
testImplementation("org.apache.commons:commons-lang3:3.17.0")
Expand Down
39 changes: 39 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[versions]
junixsocket = "2.10.1"
junixsocketVersionrange = "[2.4,3)"
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]
junit4 = { module = "junit:junit", version = "4.13.2" }
junixsocketCore = { module = "com.kohlschutter.junixsocket:junixsocket-core", version.ref = "junixsocket" }
junixsocketCommon = { module = "com.kohlschutter.junixsocket:junixsocket-common", version.ref = "junixsocket" }
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" }
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" }
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]
junixsocket = ["junixsocketCore", "junixsocketCommon"]
kotlin = ["kotlin", "kotlinCommon", "kotlinJdk7", "kotlinJdk8", "kotlinReflect", "kotlinTest"]
okhttp = ["okhttp", "okhttpMockwebserver"]
okio = ["okio", "okioJvm"]
34 changes: 13 additions & 21 deletions integrationtest/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,49 +18,41 @@ dependencies {
constraints {
implementation("org.slf4j:slf4j-api") {
version {
strictly("[1.7,3)")
prefer("2.0.16")
strictly(libs.versions.slf4jVersionrange.get())
prefer(libs.versions.slf4j.get())
}
}
listOf(
"com.squareup.okhttp3:mockwebserver",
"com.squareup.okhttp3:okhttp"
libs.bundles.okhttp
).forEach {
implementation(it) {
version {
strictly("[4,5)")
prefer("4.12.0")
strictly(libs.versions.okhttpVersionrange.get())
prefer(libs.versions.okhttp.get())
}
}
}
implementation("com.squareup.okio:okio") {
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"
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())
}
}
}
}
implementation(project(":engine"))
testImplementation("com.squareup.okhttp3:okhttp:4.12.0")

testImplementation("org.slf4j:slf4j-api:2.0.16")
testRuntimeOnly("ch.qos.logback:logback-classic:[1.2,2)!!1.3.14")

testImplementation(libs.okhttp)
testImplementation(libs.slf4j)
testRuntimeOnly(libs.logback)
testImplementation("org.spockframework:spock-core:2.3-groovy-4.0")
testRuntimeOnly("net.bytebuddy:byte-buddy:1.15.11")
}
Expand Down

0 comments on commit bd3c35d

Please sign in to comment.