-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjacoco.gradle
More file actions
41 lines (34 loc) · 1.03 KB
/
jacoco.gradle
File metadata and controls
41 lines (34 loc) · 1.03 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
32
33
34
35
36
37
38
39
40
41
apply plugin: 'jacoco'
ext {
coverageSourceDirs = 'src/test/java'
}
jacoco {
toolVersion = "0.8.5"
reportsDir = file("$buildDir/reports")
}
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
reports {
xml.enabled = true
html.enabled = true
}
def fileFilter = [
'**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/*Test*.*',
'android/**/*.*',
'**/*Activity*.*']
def debugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug", excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/kotlin"
sourceDirectories.from(files([mainSrc]))
classDirectories.from(files([debugTree]))
executionData.from(fileTree(dir: project.buildDir, includes: [
'jacoco/testDebugUnitTest.exec', 'outputs/code-coverage/connected/*coverage.ec'
]))
}
tasks.withType(Test) {
testLogging {
events "passed", "skipped", "failed"
}
}