-
Notifications
You must be signed in to change notification settings - Fork 65
/
jacoco.gradle
34 lines (27 loc) · 1.17 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
apply plugin: "jacoco"
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}
task jacocoTestReport(type: JacocoReport, dependsOn: 'testDebugUnitTest') {
reports {
xml.required = true
html.required = true
}
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*', '**/*MemberInjector.*',
'**/*$$Factory*.*', '**/*..State*.*', '**/*_ViewBinding*.*', 'com/bumptech/**/*.*', '**/injection/**/*.*',
'**/*__Factory*.*', '**/*PresenterBinder*.*', '**/*ViewState*.*']
def mainSrc = "${project.projectDir}/src/main/java"
def kotlinSrc = "${project.projectDir}/src/main/kotlin"
classDirectories.setFrom(fileTree(
dir: "$buildDir/intermediates/javac/debug/classes",
excludes: fileFilter) + fileTree(
dir: "$buildDir/tmp/kotlin-classes/debug",
excludes: fileFilter))
// sources
sourceDirectories.setFrom(files([
mainSrc,
kotlinSrc
]))
executionData.setFrom(files("${buildDir}/jacoco/testDebugUnitTest.exec"))
}