From 8e8dc54221542d1abe9484665739f0b8e488dc04 Mon Sep 17 00:00:00 2001 From: Reed Ellsworth Date: Wed, 19 Jun 2024 11:46:13 -0600 Subject: [PATCH] v1.5.0 Support for Kotlin 1.9.24 --- README.md | 1 + build.gradle.kts | 4 ++-- gradle.properties | 3 ++- gradle/wrapper/gradle-wrapper.properties | 2 +- logging/build.gradle.kts | 4 ++-- .../org/lighthousegames/logging/KmLogging.kt | 3 --- .../lighthousegames/logging/PlatformLogger.kt | 2 ++ sample/shared/build.gradle.kts | 2 +- sample/webApp/build.gradle.kts | 22 +++++++++---------- .../src/{main => jsMain}/kotlin/main.kt | 0 .../src/{main => jsMain}/resources/index.html | 0 settings.gradle.kts | 4 ++-- 12 files changed, 23 insertions(+), 24 deletions(-) rename sample/webApp/src/{main => jsMain}/kotlin/main.kt (100%) rename sample/webApp/src/{main => jsMain}/resources/index.html (100%) diff --git a/README.md b/README.md index 8c8a700..20e677e 100644 --- a/README.md +++ b/README.md @@ -149,6 +149,7 @@ KmLogging.setLoggers(PlatformLogger(FixedLogLevel(BuildConfig.DEBUG))) | KmLogging version | Kotlin version | |-------------------|----------------| +| 1.5.0 | 1.9.24 | | 1.4.2 | 1.8.22 | | 1.3.0 | 1.8.10 | | 1.2.1 | 1.7.21 | diff --git a/build.gradle.kts b/build.gradle.kts index 32e26b7..e732252 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,8 +5,8 @@ buildscript { google() } dependencies { - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.22") - classpath("com.android.tools.build:gradle:8.0.2") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.24") + classpath("com.android.tools.build:gradle:8.1.0") classpath("com.google.gms:google-services:4.4.1") classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.9") } diff --git a/gradle.properties b/gradle.properties index 5c522dc..e3f9558 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,4 +17,5 @@ licenseUrl=http://www.apache.org/licenses/LICENSE-2.0 allLicenses=["Apache-2.0"] # workaround bug in webpack 5 usage #kotlin.js.webpack.major.version=4 -kotlin.mpp.androidSourceSetLayoutVersion=2 \ No newline at end of file +kotlin.mpp.androidSourceSetLayoutVersion=2 +kotlin.js.yarn=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fd0d66a..07beaef 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Wed Feb 28 19:32:34 MST 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/logging/build.gradle.kts b/logging/build.gradle.kts index 71180f1..8d73ff7 100644 --- a/logging/build.gradle.kts +++ b/logging/build.gradle.kts @@ -4,7 +4,7 @@ plugins { id("com.android.library") kotlin("multiplatform") id("org.jetbrains.dokka") - id("com.vanniktech.maven.publish") version "0.27.0" + id("com.vanniktech.maven.publish") version "0.28.0" } kotlin { @@ -77,7 +77,7 @@ tasks { } extra["artifactId"] = "logging" -extra["artifactVersion"] = "1.4.2" +extra["artifactVersion"] = "1.5.0" extra["libraryName"] = "KmLogging: Kotlin Multiplatform Logging" extra["libraryDescription"] = "KmLogging is a high performance, extensible and easy to use logging library for Kotlin Multiplatform development" extra["gitUrl"] = "https://github.com/LighthouseGames/KmLogging" diff --git a/logging/src/commonMain/kotlin/org/lighthousegames/logging/KmLogging.kt b/logging/src/commonMain/kotlin/org/lighthousegames/logging/KmLogging.kt index 960da48..2e48944 100644 --- a/logging/src/commonMain/kotlin/org/lighthousegames/logging/KmLogging.kt +++ b/logging/src/commonMain/kotlin/org/lighthousegames/logging/KmLogging.kt @@ -1,13 +1,10 @@ package org.lighthousegames.logging import co.touchlab.stately.concurrency.AtomicReference -import kotlin.native.concurrent.SharedImmutable import kotlin.native.concurrent.ThreadLocal -@SharedImmutable internal val logFactory: AtomicReference = AtomicReference(null) -@SharedImmutable private val loggers: AtomicReference> = AtomicReference(emptyList()) @ThreadLocal diff --git a/logging/src/iosMain/kotlin/org/lighthousegames/logging/PlatformLogger.kt b/logging/src/iosMain/kotlin/org/lighthousegames/logging/PlatformLogger.kt index 182e682..c14e3da 100644 --- a/logging/src/iosMain/kotlin/org/lighthousegames/logging/PlatformLogger.kt +++ b/logging/src/iosMain/kotlin/org/lighthousegames/logging/PlatformLogger.kt @@ -1,5 +1,6 @@ package org.lighthousegames.logging +import kotlinx.cinterop.ExperimentalForeignApi import kotlinx.cinterop.ptr import platform.Foundation.NSThread import platform.darwin.OS_LOG_DEFAULT @@ -11,6 +12,7 @@ import platform.darwin.OS_LOG_TYPE_INFO import platform.darwin.__dso_handle import platform.darwin._os_log_internal +@OptIn(ExperimentalForeignApi::class) actual class PlatformLogger actual constructor(actual val logLevel: LogLevelController) : Logger, TagProvider, LogLevelController by logLevel { actual override fun verbose(tag: String, msg: String) { diff --git a/sample/shared/build.gradle.kts b/sample/shared/build.gradle.kts index 6f84502..b585736 100644 --- a/sample/shared/build.gradle.kts +++ b/sample/shared/build.gradle.kts @@ -6,7 +6,7 @@ plugins { } kotlin { - android() + androidTarget() listOf( iosX64(), iosArm64(), diff --git a/sample/webApp/build.gradle.kts b/sample/webApp/build.gradle.kts index 5fedbf7..63c9efc 100644 --- a/sample/webApp/build.gradle.kts +++ b/sample/webApp/build.gradle.kts @@ -1,20 +1,18 @@ plugins { - kotlin("js") -} - -dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-html:0.7.3") - implementation(project(":sample:shared")) + kotlin("multiplatform") } kotlin { - js(IR) { + js { browser { - binaries.executable() - commonWebpackConfig { - cssSupport { - enabled.set(true) - } + } + binaries.executable() + } + sourceSets { + val jsMain by getting { + dependencies { + implementation("org.jetbrains.kotlinx:kotlinx-html:0.8.0") + implementation(project(":sample:shared")) } } } diff --git a/sample/webApp/src/main/kotlin/main.kt b/sample/webApp/src/jsMain/kotlin/main.kt similarity index 100% rename from sample/webApp/src/main/kotlin/main.kt rename to sample/webApp/src/jsMain/kotlin/main.kt diff --git a/sample/webApp/src/main/resources/index.html b/sample/webApp/src/jsMain/resources/index.html similarity index 100% rename from sample/webApp/src/main/resources/index.html rename to sample/webApp/src/jsMain/resources/index.html diff --git a/settings.gradle.kts b/settings.gradle.kts index a2c4f25..6c4b4e9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,8 +4,8 @@ pluginManagement { gradlePluginPortal() } plugins { - id("org.jetbrains.dokka") version "1.9.10" - kotlin("multiplatform") version "1.9.20" + id("org.jetbrains.dokka") version "1.9.20" + kotlin("multiplatform") version "1.9.24" } }