mirror of https://github.com/apache/jmeter.git
chore: use Java 17 for building the build scripts
This commit is contained in:
parent
b080ca648f
commit
9b4221a23e
|
|
@ -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 }
|
||||
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue