Skip to content

Commit 68bd153

Browse files
committed
Migrate to Gradle versions catalog
1 parent 0028bdb commit 68bd153

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

build.gradle.kts

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ description = "A logger facilitating lazily-evaluated log calls via Kotlin's inl
1313
plugins {
1414
`maven-publish`
1515
signing
16-
kotlin("multiplatform") version "1.8.21"
17-
id("org.jetbrains.dokka") version "1.8.10"
18-
id("com.github.ben-manes.versions") version "0.46.0"
16+
17+
alias(libs.plugins.kotlin.multiplatform)
18+
alias(libs.plugins.dokka)
19+
alias(libs.plugins.versions)
1920
}
2021

2122
tasks.withType<DependencyUpdatesTask> {
@@ -40,14 +41,16 @@ repositories {
4041
}
4142

4243
kotlin {
44+
jvmToolchain(8)
45+
4346
sourceSets {
44-
named("commonMain") {
47+
commonMain {
4548
dependencies {
4649
implementation(kotlin("stdlib-common"))
4750
}
4851
}
4952

50-
named("commonTest") {
53+
commonTest {
5154
dependencies {
5255
implementation(kotlin("test-common"))
5356
implementation(kotlin("test-annotations-common"))
@@ -57,27 +60,17 @@ kotlin {
5760

5861
jvm {
5962
compilations.named("main") {
60-
kotlinOptions {
61-
jvmTarget = "1.8"
62-
freeCompilerArgs = listOf("-Xno-call-assertions", "-Xno-receiver-assertions", "-Xno-param-assertions")
63-
}
64-
6563
dependencies {
6664
implementation(kotlin("stdlib-jdk8"))
67-
implementation("org.slf4j:slf4j-api:2.0.7")
65+
implementation(libs.slf4j.api)
6866
}
6967
}
7068

7169
compilations.named("test") {
72-
kotlinOptions {
73-
jvmTarget = "1.8"
74-
freeCompilerArgs = listOf("-Xno-call-assertions", "-Xno-receiver-assertions", "-Xno-param-assertions")
75-
}
76-
7770
dependencies {
7871
implementation(kotlin("test"))
7972
implementation(kotlin("test-junit"))
80-
implementation("org.slf4j:slf4j-jdk14:2.0.7")
73+
implementation(libs.slf4j.jdk14)
8174
}
8275
}
8376

gradle/libs.versions.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[versions]
2+
kotlin = "1.8.10"
3+
dokka = "1.8.10"
4+
slf4j = "2.0.7"
5+
versions-plugin = "0.46.0"
6+
7+
[libraries]
8+
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
9+
slf4j-jdk14 = { module = "org.slf4j:slf4j-jdk14", version.ref = "slf4j" }
10+
11+
[plugins]
12+
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
13+
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
14+
versions = { id = "com.github.ben-manes.versions", version.ref = "versions-plugin" }

src/jvmTest/kotlin/com/github/michaelbull/logging/InlineLoggerTest.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@file:Suppress("unused")
2-
31
package com.github.michaelbull.logging
42

53
import kotlin.test.Test
@@ -24,5 +22,4 @@ class InlineLoggerTest {
2422
val logger = InlineLogger()
2523
assertEquals("com.github.michaelbull.logging.InlineLoggerTest", logger.name)
2624
}
27-
2825
}

0 commit comments

Comments
 (0)