From e9e3e8379725759dcd4639655409b40be7c57c5c Mon Sep 17 00:00:00 2001 From: Bitmap Date: Thu, 8 Aug 2024 16:01:05 +0530 Subject: [PATCH] Kotlin 2.0 Migration and Fixed Issue With New Compiler Options DSL #160 --- buildkonfig-compiler/build.gradle.kts | 6 ++++-- buildkonfig-gradle-plugin/build.gradle.kts | 6 ++++-- gradle/libs.versions.toml | 3 +-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/buildkonfig-compiler/build.gradle.kts b/buildkonfig-compiler/build.gradle.kts index 72fcb00..a8c49f7 100644 --- a/buildkonfig-compiler/build.gradle.kts +++ b/buildkonfig-compiler/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + plugins { alias(libs.plugins.kotlin.jvm) alias(libs.plugins.mavenPublish) @@ -41,10 +43,10 @@ afterEvaluate { } tasks.compileKotlin { - kotlinOptions.jvmTarget = libs.versions.jvmTarget.get() + compilerOptions { jvmTarget.set(JvmTarget.JVM_1_8) } } tasks.compileTestKotlin { - kotlinOptions.jvmTarget = libs.versions.jvmTarget.get() + compilerOptions { jvmTarget.set(JvmTarget.JVM_1_8) } } apply(from = "$rootDir/gradle/maven-publish.gradle") diff --git a/buildkonfig-gradle-plugin/build.gradle.kts b/buildkonfig-gradle-plugin/build.gradle.kts index 53c803e..dba699c 100644 --- a/buildkonfig-gradle-plugin/build.gradle.kts +++ b/buildkonfig-gradle-plugin/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + plugins { alias(libs.plugins.kotlin.jvm) alias(libs.plugins.mavenPublish) @@ -52,10 +54,10 @@ dependencies { } tasks.compileKotlin { - kotlinOptions.jvmTarget = libs.versions.jvmTarget.get() + compilerOptions { jvmTarget.set(JvmTarget.JVM_1_8) } } tasks.compileTestKotlin { - kotlinOptions.jvmTarget = libs.versions.jvmTarget.get() + compilerOptions { jvmTarget.set(JvmTarget.JVM_1_8) } } apply(from = "$rootDir/gradle/maven-publish.gradle") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index bb95af1..e7762c2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,9 +1,8 @@ [versions] gradle = "8.2.1" -kotlin = "1.9.22" +kotlin = "2.0.0" dokka = "1.9.20" android = "8.1.1" -jvmTarget = "1.8" [libraries] kotlinpoet = { module = "com.squareup:kotlinpoet", version = "1.17.0" }