This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 9b4221a23e chore: use Java 17 for building the build scripts
9b4221a23e is described below

commit 9b4221a23ef1aec2b6415115049ce768385aa69b
Author: Vladimir Sitnikov <[email protected]>
AuthorDate: Fri Nov 24 13:17:19 2023 +0300

    chore: use Java 17 for building the build scripts
---
 build-logic-commons/gradle-plugin/build.gradle.kts  |  2 +-
 .../build-logic.kotlin-dsl-gradle-plugin.gradle.kts | 21 +++------------------
 2 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/build-logic-commons/gradle-plugin/build.gradle.kts 
b/build-logic-commons/gradle-plugin/build.gradle.kts
index 90f37494f4..550c4334ae 100644
--- a/build-logic-commons/gradle-plugin/build.gradle.kts
+++ b/build-logic-commons/gradle-plugin/build.gradle.kts
@@ -39,7 +39,7 @@ dependencies {
 val currentJava = JavaVersion.current()
 if (currentJava > JavaVersion.VERSION_1_8) {
     // We want an LTS Java release for build script compilation
-    val latestSupportedLts = listOf("25", "21", "17", "11")
+    val latestSupportedLts = listOf("17", "11")
         .intersect(JvmTarget.values().mapTo(mutableSetOf()) { it.target })
         .first { JavaVersion.toVersion(it) <= currentJava }
 
diff --git 
a/build-logic-commons/gradle-plugin/src/main/kotlin/build-logic.kotlin-dsl-gradle-plugin.gradle.kts
 
b/build-logic-commons/gradle-plugin/src/main/kotlin/build-logic.kotlin-dsl-gradle-plugin.gradle.kts
index ee27e739c3..278d417402 100644
--- 
a/build-logic-commons/gradle-plugin/src/main/kotlin/build-logic.kotlin-dsl-gradle-plugin.gradle.kts
+++ 
b/build-logic-commons/gradle-plugin/src/main/kotlin/build-logic.kotlin-dsl-gradle-plugin.gradle.kts
@@ -15,9 +15,6 @@
  * limitations under the License.
  */
 
-import org.jetbrains.kotlin.gradle.dsl.JvmTarget
-import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
-
 plugins {
     id("java-library")
     id("org.gradle.kotlin.kotlin-dsl") // this is 'kotlin-dsl' without version
@@ -28,20 +25,8 @@ tasks.validatePlugins {
     enableStricterValidation.set(true)
 }
 
-val currentJava = JavaVersion.current()
-if (currentJava > JavaVersion.VERSION_1_8) {
-    // We want an LTS Java release for build script compilation
-    val latestSupportedLts = listOf("25", "21", "17", "11")
-        .intersect(JvmTarget.values().mapTo(mutableSetOf()) { it.target })
-        .first { JavaVersion.toVersion(it) <= currentJava }
-
-    tasks.withType<JavaCompile>().configureEach {
-        
options.release.set(JavaVersion.toVersion(latestSupportedLts).majorVersion.toInt())
-    }
-
-    tasks.withType<KotlinCompile>().configureEach {
-        kotlinOptions {
-            jvmTarget = latestSupportedLts
-        }
+java {
+    toolchain {
+        languageVersion.set(JavaLanguageVersion.of(17))
     }
 }

Reply via email to