Replaced jvmToolChain with Kotlin/Java compile options
This commit is contained in:
parent
57eb20a160
commit
e5cb0bd903
1 changed files with 22 additions and 8 deletions
|
@ -3,7 +3,10 @@ package buildsrc.conventions.lang
|
||||||
import buildsrc.utils.Rife2TestListener
|
import buildsrc.utils.Rife2TestListener
|
||||||
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.kotlin.gradle.dsl.JvmTarget
|
||||||
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
|
import org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
|
||||||
|
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,7 +25,7 @@ plugins {
|
||||||
|
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvmToolchain(11)
|
//jvmToolchain(11)
|
||||||
|
|
||||||
targets.configureEach {
|
targets.configureEach {
|
||||||
compilations.configureEach {
|
compilations.configureEach {
|
||||||
|
@ -49,11 +52,22 @@ kotlin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<Test>().configureEach {
|
tasks {
|
||||||
val testsBadgeApiKey = providers.gradleProperty("testsBadgeApiKey")
|
withType<JavaCompile>().configureEach {
|
||||||
addTestListener(Rife2TestListener(testsBadgeApiKey))
|
sourceCompatibility = JavaVersion.VERSION_11.toString()
|
||||||
testLogging {
|
targetCompatibility = JavaVersion.VERSION_11.toString()
|
||||||
exceptionFormat = TestExceptionFormat.FULL
|
|
||||||
events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
withType<KotlinJvmCompile>().configureEach {
|
||||||
|
compilerOptions.jvmTarget.set(JvmTarget.JVM_11)
|
||||||
|
}
|
||||||
|
|
||||||
|
withType<Test>().configureEach {
|
||||||
|
val testsBadgeApiKey = providers.gradleProperty("testsBadgeApiKey")
|
||||||
|
addTestListener(Rife2TestListener(testsBadgeApiKey))
|
||||||
|
testLogging {
|
||||||
|
exceptionFormat = TestExceptionFormat.FULL
|
||||||
|
events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue