Skip to content

Commit

Permalink
Migrate to Gradle versions catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbull committed May 2, 2023
1 parent 0028bdb commit 68bd153
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
27 changes: 10 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ description = "A logger facilitating lazily-evaluated log calls via Kotlin's inl
plugins {
`maven-publish`
signing
kotlin("multiplatform") version "1.8.21"
id("org.jetbrains.dokka") version "1.8.10"
id("com.github.ben-manes.versions") version "0.46.0"

alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.dokka)
alias(libs.plugins.versions)
}

tasks.withType<DependencyUpdatesTask> {
Expand All @@ -40,14 +41,16 @@ repositories {
}

kotlin {
jvmToolchain(8)

sourceSets {
named("commonMain") {
commonMain {
dependencies {
implementation(kotlin("stdlib-common"))
}
}

named("commonTest") {
commonTest {
dependencies {
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
Expand All @@ -57,27 +60,17 @@ kotlin {

jvm {
compilations.named("main") {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xno-call-assertions", "-Xno-receiver-assertions", "-Xno-param-assertions")
}

dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("org.slf4j:slf4j-api:2.0.7")
implementation(libs.slf4j.api)
}
}

compilations.named("test") {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xno-call-assertions", "-Xno-receiver-assertions", "-Xno-param-assertions")
}

dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-junit"))
implementation("org.slf4j:slf4j-jdk14:2.0.7")
implementation(libs.slf4j.jdk14)
}
}

Expand Down
14 changes: 14 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[versions]
kotlin = "1.8.10"
dokka = "1.8.10"
slf4j = "2.0.7"
versions-plugin = "0.46.0"

[libraries]
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
slf4j-jdk14 = { module = "org.slf4j:slf4j-jdk14", version.ref = "slf4j" }

[plugins]
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
versions = { id = "com.github.ben-manes.versions", version.ref = "versions-plugin" }
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:Suppress("unused")

package com.github.michaelbull.logging

import kotlin.test.Test
Expand All @@ -24,5 +22,4 @@ class InlineLoggerTest {
val logger = InlineLogger()
assertEquals("com.github.michaelbull.logging.InlineLoggerTest", logger.name)
}

}

0 comments on commit 68bd153

Please sign in to comment.