Skip to content

Commit 87666c7

Browse files
authored
Fix Kotlin Gradle plugin warning
> 'kotlinOptions: KotlinJvmOptions' is deprecated. > Please migrate to the compilerOptions DSL. > More details are here: https://kotl.in/u1r8ln
1 parent 4c55f12 commit 87666c7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
12
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
23
import org.sonarsource.kotlin.buildsrc.tasks.CreateKotlinGradleRuleStubsTask
34
import org.sonarsource.kotlin.buildsrc.tasks.CreateKotlinRuleStubsTask
@@ -125,7 +126,7 @@ subprojects {
125126
}
126127

127128
tasks.withType<KotlinCompile>().all {
128-
kotlinOptions.jvmTarget = java.sourceCompatibility.toString()
129+
compilerOptions.jvmTarget = JvmTarget.fromTarget(java.sourceCompatibility.toString())
129130
}
130131

131132
jacoco {

kotlin-checks-test-sources/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies {
2424
sonarqube.isSkipProject = true
2525

2626
val compileKotlin: KotlinCompile by tasks
27-
compileKotlin.kotlinOptions {
27+
compileKotlin.compilerOptions {
2828
suppressWarnings = true
2929
}
3030

0 commit comments

Comments
 (0)