bld-jacoco-report/examples/build.gradle.kts

43 lines
No EOL
1 KiB
Kotlin

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
// Apply the java-library plugin for API and implementation separation.
`java-library`
`jacoco`
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
testImplementation("org.junit.jupiter", "junit-jupiter", "5.9.2")
testImplementation("org.junit.platform", "junit-platform-console-standalone", "1.9.2")
}
// Apply a specific Java toolchain to ease working on different environments.
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
tasks {
test {
useJUnitPlatform()
testLogging {
exceptionFormat = TestExceptionFormat.FULL
events = setOf(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
}
}
}
tasks.jacocoTestReport {
reports {
xml.required.set(true)
csv.required.set(true)
html.required.set(true)
}
}