-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjacoco.gradle
More file actions
31 lines (24 loc) · 1 KB
/
jacoco.gradle
File metadata and controls
31 lines (24 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.8.7"
}
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
group = "CoverageReport"
description = "Generate coverage report for unit tests and ui tests"
reports {
xml.enabled = true
html.enabled = true
}
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
def debugTree = fileTree(dir: "${buildDir}/intermediates/javac/debug", excludes: fileFilter)
def kotlinDebugTree = fileTree(dir: "${buildDir}/tmp/kotlin-classes/debug", excludes: fileFilter)
def mainSrc = "${project.projectDir}/src/main/java"
sourceDirectories.setFrom(files([mainSrc]))
classDirectories.setFrom(files([debugTree,kotlinDebugTree]))
executionData(fileTree(dir: "$buildDir", includes: [
"jacoco/testDebugUnitTest.exec"]))
}