Use JDK 17 toolchain and set -Xjdk-release=11

This commit is contained in:
Jason Penilla 2024-01-09 15:12:05 -07:00
parent 4bc9495f03
commit 0b3688ca5b
No known key found for this signature in database
GPG key ID: 0E75A301420E48F8

View file

@ -1,6 +1,5 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import net.kyori.indra.licenser.spotless.IndraSpotlessLicenserExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
idea
@ -11,9 +10,21 @@ java {
withSourcesJar()
}
tasks.withType(JavaCompile::class).configureEach {
options.release = 11
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion = JavaLanguageVersion.of(17)
}
target {
compilations.configureEach {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs = listOf("-Xjvm-default=all", "-Xjdk-release=11")
}
}
}
}
@ -56,13 +67,6 @@ testing {
}
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs = listOf("-Xjvm-default=all")
}
}
tasks.jar {
manifest {
attributes(