Reverted to using jvmTarget

This commit is contained in:
Erik C. Thauvin 2023-02-23 14:14:20 -08:00
parent bd3ee412fe
commit a1d914c895

View file

@ -1,6 +1,7 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.dokka.gradle.DokkaTask import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
id("com.github.ben-manes.versions") version "0.46.0" id("com.github.ben-manes.versions") version "0.46.0"
@ -40,9 +41,8 @@ dependencies {
} }
java { java {
toolchain { sourceCompatibility = JavaVersion.VERSION_11
languageVersion.set(JavaLanguageVersion.of(11)) targetCompatibility = JavaVersion.VERSION_11
}
withSourcesJar() withSourcesJar()
} }
@ -67,6 +67,10 @@ tasks {
useJUnitPlatform() useJUnitPlatform()
} }
withType<KotlinCompile>().configureEach {
kotlinOptions.jvmTarget = java.targetCompatibility.toString()
}
withType<Test> { withType<Test> {
testLogging { testLogging {
exceptionFormat = TestExceptionFormat.FULL exceptionFormat = TestExceptionFormat.FULL
@ -74,6 +78,14 @@ tasks {
} }
} }
withType<io.gitlab.arturbosch.detekt.Detekt>().configureEach {
this.jvmTarget = java.targetCompatibility.toString()
}
withType<io.gitlab.arturbosch.detekt.DetektCreateBaselineTask>().configureEach {
this.jvmTarget = java.targetCompatibility.toString()
}
withType<GenerateMavenPom> { withType<GenerateMavenPom> {
destination = file("$projectDir/pom.xml") destination = file("$projectDir/pom.xml")
} }