-
Notifications
You must be signed in to change notification settings - Fork 3
fix: target Kotlin 2.0, so the plugin is compatible with Gradle 8.3+ #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,7 @@ | ||
| import org.gradle.api.tasks.testing.logging.TestExceptionFormat | ||
| import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
| import org.jetbrains.kotlin.gradle.dsl.KotlinVersion | ||
| import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile | ||
|
|
||
| plugins { | ||
| `kotlin-dsl` | ||
|
|
@@ -37,7 +40,19 @@ gradlePlugin { | |
| } | ||
| } | ||
|
|
||
| kotlin { jvmToolchain(17) } | ||
| kotlin { | ||
| jvmToolchain(17) | ||
| coreLibrariesVersion = "2.0.0" | ||
| } | ||
|
|
||
| tasks.withType<KotlinJvmCompile>().configureEach { | ||
| compilerOptions { | ||
| jvmTarget = JvmTarget.JVM_17 | ||
| freeCompilerArgs.add("-Xjdk-release=17") | ||
| apiVersion = KotlinVersion.KOTLIN_2_0 | ||
| languageVersion = KotlinVersion.KOTLIN_2_0 | ||
| } | ||
| } | ||
|
Comment on lines
+48
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: Check the Kotlin Gradle Plugin version used in this project
# Check for Kotlin plugin version in version catalog
fd --type f "libs.versions.toml" --exec cat {}
# Also check if any explicit Kotlin version is set in build files
rg -n "kotlin.*version" --type kotlin --type groovyRepository: typetools/checker-framework-gradle-plugin Length of output: 543 🏁 Script executed: cat build.gradle.ktsRepository: typetools/checker-framework-gradle-plugin Length of output: 3443 Configuration correctly targets Kotlin 2.0; minor JVM target redundancy exists. The ♻️ Optional: Remove redundant JVM target configurationIf you prefer a leaner configuration, you can rely on tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions {
- jvmTarget = JvmTarget.JVM_17
- freeCompilerArgs.add("-Xjdk-release=17")
apiVersion = KotlinVersion.KOTLIN_2_0
languageVersion = KotlinVersion.KOTLIN_2_0
}
}The current explicit configuration is also valid if you want to ensure no ambiguity. 🤖 Prompt for AI Agents |
||
|
|
||
| testing { | ||
| suites { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Ideally, the build should use the latest JDK (e.g. Java 25) and target older bytecode/release. I did not modify the toolchain so far as it is not directly connected with the key change.