Skip to content

Commit

Permalink
Upgrade to K2 compiler. Using 2.0.21 for now, because Kotlinter is cu…
Browse files Browse the repository at this point in the history
…rrently not yet 2.1 compatible.
  • Loading branch information
paulbakker committed Dec 2, 2024
1 parent fe7256e commit 8297b6f
Show file tree
Hide file tree
Showing 34 changed files with 14,004 additions and 2,304 deletions.
30 changes: 9 additions & 21 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ plugins {
id("nebula.netflixoss") version "11.4.0"
id("io.spring.dependency-management") version "1.1.6"

id("org.jmailen.kotlinter") version "4.4.+"
id("org.jmailen.kotlinter") version "4.5.+"
id("me.champeau.jmh") version "0.7.2"

kotlin("jvm") version Versions.KOTLIN_VERSION
Expand Down Expand Up @@ -106,12 +106,6 @@ configure(subprojects.filterNot { it in internalBomModules }) {
testImplementation("io.mockk:mockk:1.+")
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}

jmh {
includeTests.set(true)
jmhTimeout.set("5s")
Expand All @@ -130,20 +124,6 @@ configure(subprojects.filterNot { it in internalBomModules }) {
options.compilerArgs.addAll(listOf("-parameters", "-deprecation"))
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
/*
* Prior to Kotlin 1.6 we had `jvm-default=enable`, 1.6.20 adds `-Xjvm-default=all-compatibility`
* > .. generate compatibility stubs in the DefaultImpls classes.
* > Compatibility stubs could be useful for library and runtime authors to keep backward binary
* > compatibility for existing clients compiled against previous library versions.
* Ref. https://kotlinlang.org/docs/kotlin-reference.pdf
*/
freeCompilerArgs = freeCompilerArgs + "-Xjvm-default=all-compatibility" + "-java-parameters"
jvmTarget = "17"
}
}

tasks {
test {
useJUnitPlatform()
Expand All @@ -156,6 +136,14 @@ configure(subprojects.filterNot { it in internalBomModules }) {
}
}

kotlin {
jvmToolchain(17)
compilerOptions {
javaParameters = true
freeCompilerArgs.addAll("-Xjvm-default=all-compatibility", "-java-parameters")
}
}

kotlinter {
reporters = arrayOf("checkstyle", "plain")
}
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
*/

object Versions {
const val KOTLIN_VERSION = "1.9.25"
const val KOTLIN_VERSION = "2.0.21"
}
Loading

0 comments on commit 8297b6f

Please sign in to comment.