32 lines
825 B
Groovy
32 lines
825 B
Groovy
apply plugin: "jacoco"
|
|
|
|
jacoco {
|
|
toolVersion = libs.versions.jacoco.get()
|
|
}
|
|
|
|
tasks.withType(Test) {
|
|
jacoco.includeNoLocationClasses = true
|
|
jacoco.excludes = ['jdk.internal.*']
|
|
}
|
|
|
|
task jacocoTestReport(
|
|
type: JacocoReport,
|
|
group: "verification"
|
|
) {
|
|
reports {
|
|
xml.enabled = true
|
|
html.enabled = true
|
|
}
|
|
|
|
def coverageExcludes = []
|
|
def debugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug", excludes: coverageExcludes)
|
|
def mainSrc = "$project.projectDir/src/main/java"
|
|
|
|
getSourceDirectories().setFrom(files([mainSrc]))
|
|
getClassDirectories().setFrom(files([debugTree]))
|
|
getExecutionData().setFrom(fileTree(dir: project.buildDir, includes: [
|
|
"jacoco/testDebugUnitTest.exec",
|
|
"outputs/code-coverage/connected/*coverage.ec"
|
|
]))
|
|
}
|