Skip to content

Commit

Permalink
migrated deprecated kotlinOptions to compilerOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolanrensen committed Aug 27, 2024
1 parent 231ed08 commit 5be47cb
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 18 deletions.
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import com.github.gmazzo.buildconfig.BuildConfigExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlinx.dataframe.AnyFrame
Expand Down Expand Up @@ -133,8 +134,8 @@ kotlin.jvmToolchain(11)

allprojects {
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}

Expand Down
3 changes: 2 additions & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ tasks.withType<JavaCompile> {

tasks.withType<KotlinCompile> {
compilerOptions {
freeCompilerArgs.addAll("-Xinline-classes", "-Xopt-in=kotlin.RequiresOptIn")
optIn.addAll("kotlin.RequiresOptIn")
freeCompilerArgs.addAll("-Xinline-classes")
}
}

Expand Down
3 changes: 2 additions & 1 deletion examples/idea-examples/json/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlinx.dataframe.api.JsonPath

Expand All @@ -22,7 +23,7 @@ dependencies {
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
}

dataframes {
Expand Down
3 changes: 2 additions & 1 deletion examples/idea-examples/movies/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -23,5 +24,5 @@ dependencies {
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
}
4 changes: 3 additions & 1 deletion examples/idea-examples/titanic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
application
kotlin("jvm")
Expand Down Expand Up @@ -35,7 +37,7 @@ dataframes {
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "11"
compilerOptions.jvmTarget = JvmTarget.JVM_11
}

tasks.withType<JavaCompile> {
Expand Down
3 changes: 2 additions & 1 deletion examples/idea-examples/youtube/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
Expand All @@ -24,6 +25,6 @@ dependencies {
}

tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
}

4 changes: 3 additions & 1 deletion plugins/dataframe-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
`kotlin-dsl`
`java-gradle-plugin`
Expand Down Expand Up @@ -86,7 +88,7 @@ gradlePlugin {
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
compilerOptions.jvmTarget = JvmTarget.JVM_1_8
}

tasks.withType<JavaCompile>().all {
Expand Down
27 changes: 17 additions & 10 deletions plugins/kotlin-dataframe/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion

plugins {
id("java")
kotlin("jvm")
Expand Down Expand Up @@ -67,10 +70,14 @@ tasks.test {
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
freeCompilerArgs += listOf("-Xfriend-paths=${project(":core").projectDir}")
freeCompilerArgs += "-opt-in=org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi"
freeCompilerArgs += "-Xcontext-receivers"
compilerOptions {
freeCompilerArgs.addAll(
"-Xfriend-paths=${project(":core").projectDir}",
"-Xcontext-receivers",
)
optIn.addAll(
"org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi",
)
}
}

Expand All @@ -80,16 +87,16 @@ tasks.withType<JavaCompile> {
}

tasks.compileKotlin {
kotlinOptions {
languageVersion = "2.0"
jvmTarget = "1.8"
compilerOptions {
languageVersion = KotlinVersion.KOTLIN_2_0
jvmTarget = JvmTarget.JVM_1_8
}
}

tasks.compileTestKotlin {
kotlinOptions {
languageVersion = "2.0"
jvmTarget = "1.8"
compilerOptions {
languageVersion = KotlinVersion.KOTLIN_2_0
jvmTarget = JvmTarget.JVM_1_8
}
}

Expand Down

0 comments on commit 5be47cb

Please sign in to comment.