From 14c05d70b52814fe48e930b3f61fed5e8586718c Mon Sep 17 00:00:00 2001 From: Goooler Date: Wed, 8 Mar 2023 10:43:08 +0800 Subject: Migrate kotlinOptions to compilerOptions (#2883) More information: https://kotlinlang.org/docs/gradle-compiler-options.html#how-to-define-options --- .../jetbrains/conventions/kotlin-jvm.gradle.kts | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'buildSrc') diff --git a/buildSrc/src/main/kotlin/org/jetbrains/conventions/kotlin-jvm.gradle.kts b/buildSrc/src/main/kotlin/org/jetbrains/conventions/kotlin-jvm.gradle.kts index bd33df22..c40ce57c 100644 --- a/buildSrc/src/main/kotlin/org/jetbrains/conventions/kotlin-jvm.gradle.kts +++ b/buildSrc/src/main/kotlin/org/jetbrains/conventions/kotlin-jvm.gradle.kts @@ -1,6 +1,7 @@ package org.jetbrains.conventions import org.jetbrains.configureDokkaVersion +import org.jetbrains.kotlin.gradle.dsl.KotlinVersion import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { @@ -14,16 +15,18 @@ configureDokkaVersion() val language_version: String by project tasks.withType().configureEach { - kotlinOptions { - freeCompilerArgs += listOf( - "-opt-in=kotlin.RequiresOptIn", - "-Xjsr305=strict", - "-Xskip-metadata-version-check", - // need 1.4 support, otherwise there might be problems with Gradle 6.x (it's bundling Kotlin 1.4) - "-Xsuppress-version-warnings" + compilerOptions { + freeCompilerArgs.addAll( + listOf( + "-opt-in=kotlin.RequiresOptIn", + "-Xjsr305=strict", + "-Xskip-metadata-version-check", + // need 1.4 support, otherwise there might be problems with Gradle 6.x (it's bundling Kotlin 1.4) + "-Xsuppress-version-warnings" + ) ) - allWarningsAsErrors = true - languageVersion = language_version - apiVersion = language_version + allWarningsAsErrors.set(true) + languageVersion.set(KotlinVersion.fromVersion(language_version)) + apiVersion.set(KotlinVersion.fromVersion(language_version)) } } -- cgit