Skip to content

Commit

Permalink
Merge pull request #2079 from Netflix/feature/k2
Browse files Browse the repository at this point in the history
Upgrade to K2 compiler.
  • Loading branch information
paulbakker authored Dec 10, 2024
2 parents 28fd6e5 + 251d1df commit 4e46433
Show file tree
Hide file tree
Showing 38 changed files with 14,021 additions and 2,321 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 4e46433

Please sign in to comment.