-
Notifications
You must be signed in to change notification settings - Fork 29
/
jacoco-report.gradle
39 lines (34 loc) · 1.3 KB
/
jacoco-report.gradle
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
32
33
34
35
36
37
38
39
apply plugin: 'jacoco'
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
}
task jacocoCoverageTestReport(type: JacocoReport, dependsOn: ['testCoverageDebugUnitTest', 'createCoverageDebugCoverageReport']) {
reports {
xml.enabled = true
html.enabled = true
}
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
def coverageDebugTree = fileTree(dir: "$project.buildDir/intermediates/classes/coverageDebug", excludes: fileFilter)
def coverageDebugTreeNewGradle = fileTree(dir: "$project.buildDir/intermediates/javac/coverageDebug/classes", excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/java"
sourceDirectories = files([mainSrc])
classDirectories = files([coverageDebugTree, coverageDebugTreeNewGradle])
executionData = fileTree(dir: project.buildDir, includes: [
'jacoco/testCoverageDebugUnitTest.exec', 'outputs/code-coverage/connected/*coverage.ec'
])
}
android {
testOptions {
unitTests.returnDefaultValues = true
}
buildTypes {
debug {
minifyEnabled false
testCoverageEnabled true
}
coverageDebug {
minifyEnabled false
testCoverageEnabled true
}
}
}