aboutsummaryrefslogtreecommitdiff
path: root/buildSrc
diff options
context:
space:
mode:
authorGoooler <wangzongler@gmail.com>2023-03-08 10:43:08 +0800
committerGitHub <noreply@github.com>2023-03-08 03:43:08 +0100
commit14c05d70b52814fe48e930b3f61fed5e8586718c (patch)
tree3c5a6453a44ad6a499b44ac24761e5ee296fcb9b /buildSrc
parent62c980707d23d2d451c75330f7ed1ba613777cf3 (diff)
downloaddokka-14c05d70b52814fe48e930b3f61fed5e8586718c.tar.gz
dokka-14c05d70b52814fe48e930b3f61fed5e8586718c.tar.bz2
dokka-14c05d70b52814fe48e930b3f61fed5e8586718c.zip
Migrate kotlinOptions to compilerOptions (#2883)
More information: https://kotlinlang.org/docs/gradle-compiler-options.html#how-to-define-options
Diffstat (limited to 'buildSrc')
-rw-r--r--buildSrc/src/main/kotlin/org/jetbrains/conventions/kotlin-jvm.gradle.kts23
1 files changed, 13 insertions, 10 deletions
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<KotlinCompile>().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))
}
}