-
Notifications
You must be signed in to change notification settings - Fork 48
/
jacoco.gradle
45 lines (35 loc) · 1.2 KB
/
jacoco.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
40
41
42
43
44
45
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.8.8"
}
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
}
task jacocoTestReport(type: JacocoReport, dependsOn: ['connectedCheck']) {
group = "Reporting"
description = "Generate Jacoco coverage reports for Debug build"
reports {
xml.required = true
html.required = true
}
def fileFilter = [
'**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/*Test*.*',
'android/**/*.*',
'**/androidx/**/*.*',
'**/com/google/**/*.*',
'**/com/squareup/**/*.*',
'**/com/facebook/**/*.*',
'**/org/junit/**/*.*',
'**/org/mockito/**/*.*',
'**/org/hamcrest/**/*.*'
]
def debugTree = fileTree(dir: "${project.buildDir}/intermediates/classes/debug", excludes: fileFilter)
def mainSrc = "${project.projectDir}/src/main/java"
sourceDirectories.from = files([mainSrc])
classDirectories.from = files([debugTree])
executionData.from = fileTree(dir: "${buildDir}/outputs/code_coverage/normalDebugAndroidTest/connected/", includes: ["**/*.ec"])
}