ham1 commented on code in PR #6877:
URL: https://github.com/apache/jmeter/pull/6877#discussion_r4732645077
##########
build-logic-commons/gradle-plugin/src/main/kotlin/build-logic.kotlin-dsl-gradle-plugin.gradle.kts:
##########
@@ -25,14 +28,16 @@ tasks.validatePlugins {
enableStricterValidation.set(true)
}
-// We need to figure out a version that is supported by the current JVM, and
by the Kotlin Gradle plugin
-// So we settle on 21, 17, or 11 if the current JVM supports it
-listOf(21, 17, 11)
+// Compile with the JDK running Gradle and keep the plugin bytecode within
+// the JVM targets supported by Gradle's bundled Kotlin compiler.
+listOf(21, 17)
.firstOrNull { JavaVersion.toVersion(it) <= JavaVersion.current() }
?.let { buildScriptJvmTarget ->
java {
- toolchain {
-
languageVersion.set(JavaLanguageVersion.of(buildScriptJvmTarget))
- }
+ sourceCompatibility = JavaVersion.toVersion(buildScriptJvmTarget)
+ targetCompatibility = sourceCompatibility
Review Comment:
The earlier Windows CI run failed because this code selected 21 from the
list and `java.toolchain` required an actual JDK 21 installation, even though
Gradle was already running on JDK 25. CI has toolchain downloads disabled. This
lets the included plugins compile with the JDK running Gradle and keeps Java
and Kotlin on the same bytecode target as before. Gradle 9.2.1 bundles Kotlin
2.2.20, which can emit bytecode through Java 24, so adding 25 to the list would
require updating the compiler. JMeter itself still targets Java 17.
Failed run: https://github.com/apache/jmeter/actions/runs/46286547302
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]