From 94ec50b5d2789ea34c67c9779b140444bc39ab92 Mon Sep 17 00:00:00 2001 From: Oleg Yukhnevich Date: Thu, 23 May 2024 08:18:23 +0300 Subject: [PATCH] fix Kotlin EAP warnings --- .github/workflows/ci-kotlin-eap.yml | 6 +++++- .../src/main/kotlin/ckbuild.multiplatform-base.gradle.kts | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-kotlin-eap.yml b/.github/workflows/ci-kotlin-eap.yml index a6eef63c..d6afdc29 100644 --- a/.github/workflows/ci-kotlin-eap.yml +++ b/.github/workflows/ci-kotlin-eap.yml @@ -4,6 +4,10 @@ on: schedule: - cron: '0 0 * * MON' +defaults: + run: + shell: bash + jobs: build: runs-on: ${{ matrix.os }} @@ -25,4 +29,4 @@ jobs: release: false install: mingw-w64-x86_64-openssl - - run: ./gradlew build connectedCheck publishToMavenLocal --continue -Pckbuild.skipTests=true -Pckbuild.kotlinVersionOverride=${{ matrix.kotlin-version }} -Pkotlin.experimental.tryNext=${{ matrix.try-next }} + - run: ./gradlew build connectedCheck publishToMavenLocal --continue -Pckbuild.skipTests=true -Pckbuild.warningsAsErrors=false -Pckbuild.kotlinVersionOverride=${{ matrix.kotlin-version }} -Pkotlin.experimental.tryNext=${{ matrix.try-next }} diff --git a/build-logic/src/main/kotlin/ckbuild.multiplatform-base.gradle.kts b/build-logic/src/main/kotlin/ckbuild.multiplatform-base.gradle.kts index 8c4b7188..11840b7f 100644 --- a/build-logic/src/main/kotlin/ckbuild.multiplatform-base.gradle.kts +++ b/build-logic/src/main/kotlin/ckbuild.multiplatform-base.gradle.kts @@ -21,10 +21,13 @@ plugins { id("org.jetbrains.kotlinx.kover") } +// true by default +val warningsAsErrors = providers.gradleProperty("ckbuild.warningsAsErrors").orNull?.toBoolean() ?: true + @OptIn(ExperimentalKotlinGradlePluginApi::class) kotlin { compilerOptions { - allWarningsAsErrors.set(true) + allWarningsAsErrors.set(warningsAsErrors) progressiveMode.set(true) freeCompilerArgs.add("-Xrender-internal-diagnostic-names") optIn.addAll(OptIns.ExperimentalSubclassOptIn)