Skip to content

Commit

Permalink
Kotlin 2.0 Migration and Fixed Issue With New Compiler Options DSL #160
Browse files Browse the repository at this point in the history
  • Loading branch information
iammohdzaki committed Aug 31, 2024
1 parent 627acda commit e9e3e83
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions buildkonfig-compiler/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 {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.mavenPublish)
Expand Down Expand Up @@ -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")
6 changes: 4 additions & 2 deletions buildkonfig-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 {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.mavenPublish)
Expand Down Expand Up @@ -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")
3 changes: 1 addition & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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" }
Expand Down

0 comments on commit e9e3e83

Please sign in to comment.