From 54474cf8b79a5c2555243c67ccdbedc4d4ca822a Mon Sep 17 00:00:00 2001 From: Severn Everett Date: Wed, 27 Mar 2024 17:30:09 +0100 Subject: [PATCH 1/2] Upgraded Gradle to 8.7; Upgraded Android plugin to 8.2.2; Upgraded Kotlin Coroutines version to 1.8.0; Enabled cross-platform compatibility for Spotless plugin; Silencing some compiler warnings --- .gitattributes | 4 ++++ build.gradle.kts | 13 ++++++++++--- gradle/wrapper/gradle-wrapper.properties | 4 ++-- .../io/github/oshai/kotlinlogging/SimpleTest.kt | 1 + .../io/github/oshai/kotlinlogging/SimpleJsTest.kt | 1 + versions.gradle.kts | 2 +- 6 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..dc4cb6b0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +* text eol=lf +*.bat eol=crlf +*.png binary +*.jar binary diff --git a/build.gradle.kts b/build.gradle.kts index 3cae60b6..1c34816e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,12 +1,16 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL import org.gradle.jvm.tasks.Jar import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi +import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.dsl.KotlinVersion import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { kotlin("multiplatform") version "1.9.23" - id("com.android.library") version "7.4.2" + // This version is dependent on the maximum tested version + // of this plugin within the Kotlin multiplatform library + id("com.android.library") version "8.2.2" id("org.jetbrains.dokka") version "1.9.20" @@ -28,6 +32,9 @@ repositories { mavenCentral() } +tasks.withType { + kotlinOptions.jvmTarget = JvmTarget.JVM_1_8.target +} kotlin { explicitApi() @@ -69,7 +76,7 @@ kotlin { } } } - android { + androidTarget { publishLibraryVariants("release", "debug") } val linuxTargets = listOf( @@ -206,8 +213,8 @@ android { sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") defaultConfig { minSdk = 21 - targetSdk = 31 } + @Suppress("UnstableApiUsage") testOptions { unitTests.isReturnDefaultValues = true } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 11729615..355b56d9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip -distributionSha256Sum=518a863631feb7452b8f1b3dc2aaee5f388355cc3421bbd0275fbeadd77e84b2 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip +distributionSha256Sum=194717442575a6f96e1c1befa2c30e9a4fc90f701d7aee33eb879b79e7ff05c0 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/commonTest/kotlin/io/github/oshai/kotlinlogging/SimpleTest.kt b/src/commonTest/kotlin/io/github/oshai/kotlinlogging/SimpleTest.kt index 877aafe3..29ca9c90 100644 --- a/src/commonTest/kotlin/io/github/oshai/kotlinlogging/SimpleTest.kt +++ b/src/commonTest/kotlin/io/github/oshai/kotlinlogging/SimpleTest.kt @@ -2,6 +2,7 @@ package io.github.oshai.kotlinlogging import kotlin.test.Test +@Suppress("DEPRECATION") class SimpleTest { private val logger = KotlinLogging.logger {} diff --git a/src/jsTest/kotlin/io/github/oshai/kotlinlogging/SimpleJsTest.kt b/src/jsTest/kotlin/io/github/oshai/kotlinlogging/SimpleJsTest.kt index 6c3f9b7f..deb4da6e 100644 --- a/src/jsTest/kotlin/io/github/oshai/kotlinlogging/SimpleJsTest.kt +++ b/src/jsTest/kotlin/io/github/oshai/kotlinlogging/SimpleJsTest.kt @@ -4,6 +4,7 @@ import kotlin.test.* private val logger = KotlinLogging.logger("SimpleJsTest") +@Suppress("DEPRECATION") class SimpleJsTest { private lateinit var appender: SimpleAppender diff --git a/versions.gradle.kts b/versions.gradle.kts index 2b1f4132..3845867e 100644 --- a/versions.gradle.kts +++ b/versions.gradle.kts @@ -1,5 +1,5 @@ extra["slf4j_version"] = "2.0.9" -extra["coroutines_version"] = "1.6.4" +extra["coroutines_version"] = "1.8.0" extra["log4j_version"] = "2.22.0" extra["mockito_version"] = "4.11.0" extra["junit_version"] = "5.9.2" From bf0a3c59346912aef2aca48b37657239db3c47c4 Mon Sep 17 00:00:00 2001 From: Severn Everett Date: Thu, 11 Apr 2024 11:53:07 +0200 Subject: [PATCH 2/2] Upgrading JVM version in Github workflows --- .github/workflows/cd.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/github-pages.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index ebef429a..9e0d5e22 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -18,7 +18,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: 11 + java-version: 17 - name: Publish run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -no-daemon --no-parallel --stacktrace -DSONATYPE_USERNAME_2=$SONATYPE_USERNAME_2 -DSONATYPE_PASSWORD_2=$SONATYPE_PASSWORD_2 -DGPG_PRIVATE_PASSWORD=$GPG_PRIVATE_PASSWORD -DGPG_PRIVATE_KEY=$GPG_PRIVATE_KEY env: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e413075..3c01bc6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: 11 + java-version: 17 - name: Restore Gradle cache id: cache-gradle diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 5d47ebb0..35cd1cac 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -36,7 +36,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: 11 + java-version: 17 - name: Generate Dokka HTML docs run: ./gradlew :dokkaHtml - name: Upload Dokka output