Migrate to Gradle version catalog

Closes #83
This commit is contained in:
Matthias Geisler 2023-03-20 02:20:22 +01:00 committed by Michael Bull
parent ce6131be3d
commit 41fff9eb9c
9 changed files with 49 additions and 32 deletions

1
.gitignore vendored
View File

@ -22,6 +22,7 @@ out/
# Gradle
build/
kotlin-js-store/
local.properties
# JVM error logs
hs_err_pid*.log

View File

@ -35,8 +35,8 @@ kotlin {
val commonMain by getting {
dependencies {
implementation(project(":kotlin-result-coroutines"))
implementation("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:${Versions.kotlinBenchmark}")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.kotlinCoroutines}")
implementation(libs.kotlin.benchmark.runtime)
implementation(libs.kotlin.coroutines.core)
}
}
}

View File

@ -15,12 +15,12 @@ description = "A Result monad for modelling success or failure operations."
plugins {
base
id("com.github.ben-manes.versions") version Versions.versionsPlugin
alias(libs.plugins.versions)
kotlin("multiplatform") version Versions.kotlin apply false
id("org.jetbrains.kotlinx.benchmark") version Versions.kotlinBenchmark apply false
id("org.jetbrains.dokka") version Versions.dokka apply false
id("org.jetbrains.kotlin.plugin.allopen") version Versions.kotlin apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.benchmark) apply false
alias(libs.plugins.kotlin.allopen) apply false
alias(libs.plugins.dokka) apply false
}
tasks.withType<DependencyUpdatesTask> {
@ -216,6 +216,11 @@ subprojects {
name.set("Matthew Nelson")
url.set("https://matthewnelson.io/")
}
contributor {
name.set("Matthias Geisler")
url.set("https://github.com/bitPogo")
}
}
scm {

View File

@ -1,7 +0,0 @@
plugins {
`kotlin-dsl`
}
repositories {
mavenCentral()
}

View File

@ -1 +0,0 @@
rootProject.name = "buildSrc"

View File

@ -1,9 +0,0 @@
object Versions {
const val dokka = "1.7.20"
const val kotlin = "1.8.10"
const val kotlinBenchmark = "0.4.7"
const val kotlinCoroutines = "1.6.4"
const val ktor = "2.2.3"
const val logback = "1.4.5"
const val versionsPlugin = "0.45.0"
}

View File

@ -11,12 +11,12 @@ application {
dependencies {
implementation(project(":kotlin-result"))
implementation(kotlin("stdlib-jdk8"))
implementation("ch.qos.logback:logback-classic:${Versions.logback}")
implementation("io.ktor:ktor-serialization-jackson:${Versions.ktor}")
implementation("io.ktor:ktor-server-core:${Versions.ktor}")
implementation("io.ktor:ktor-server-content-negotiation:${Versions.ktor}")
implementation("io.ktor:ktor-server-netty:${Versions.ktor}")
implementation(libs.kotlin.stdlib.jdk8)
implementation(libs.logback)
implementation(libs.ktor.serialization.jackson)
implementation(libs.ktor.server.core)
implementation(libs.ktor.server.content.negotiation)
implementation(libs.ktor.server.netty)
}
tasks.withType(KotlinCompile::class.java).all {

28
gradle/libs.versions.toml Normal file
View File

@ -0,0 +1,28 @@
[versions]
dokka = "1.7.20"
kotlin = "1.8.10"
kotlin-benchmark = "0.4.7"
kotlin-coroutines = "1.6.4"
ktor = "2.2.3"
logback = "1.4.5"
versions-plugin = "0.45.0"
[libraries]
logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" }
kotlin-benchmark-runtime = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-runtime", version.ref = "kotlin-benchmark" }
kotlin-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlin-coroutines" }
kotlin-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlin-coroutines" }
ktor-server-core = { module = "io.ktor:ktor-server-core", version.ref = "ktor" }
ktor-serialization-jackson = { module = "io.ktor:ktor-serialization-jackson", version.ref = "ktor" }
ktor-server-content-negotiation = { module = "io.ktor:ktor-server-content-negotiation", version.ref = "ktor" }
ktor-server-netty = { module = "io.ktor:ktor-server-netty", version.ref = "ktor" }
[plugins]
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
kotlin-allopen = { id = "org.jetbrains.kotlin.plugin.allopen", version.ref = "kotlin" }
kotlin-benchmark = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "kotlin-benchmark" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
versions = { id = "com.github.ben-manes.versions", version.ref = "versions-plugin" }

View File

@ -15,7 +15,7 @@ kotlin {
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.kotlinCoroutines}")
implementation(libs.kotlin.coroutines.core)
api(project(":kotlin-result"))
}
}
@ -24,7 +24,7 @@ kotlin {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${Versions.kotlinCoroutines}")
implementation(libs.kotlin.coroutines.test)
}
}