@@ -37,25 +37,25 @@ private val executionDataTree = fileTree(project.layout.buildDirectory) {
37
37
)
38
38
}
39
39
40
- // tasks {
41
- // register<JacocoReport>("jacocoDebugTestReport") {
42
- // group = "Reporting"
43
- // description = "Code coverage report for both Android and Unit tests."
44
- //
45
- // dependsOn("testDebugUnitTest")
46
- // reports {
47
- // xml.required.set(true)
48
- // html.required.set(true)
49
- // html.outputLocation.set(file("${layout.buildDirectory}/reports/jacoco/html"))
50
- // xml.outputLocation.set(file("${layout.buildDirectory}/reports/jacoco/xml/jacoco.xml"))
51
- // }
52
- // sourceDirectories.setFrom(sourceDirectoriesTree)
53
- // classDirectories.setFrom(files(classDirectoriesTree))
54
- // executionData.setFrom(executionDataTree)
55
- // }
56
- // }
57
- //
58
- // afterEvaluate {
59
- // project.tasks.getByName("testDebugUnitTest")
60
- // .finalizedBy("jacocoDebugTestReport")
61
- // }
40
+ tasks {
41
+ register<JacocoReport >(" jacocoDebugTestReport" ) {
42
+ group = " Reporting"
43
+ description = " Code coverage report for both Android and Unit tests."
44
+
45
+ dependsOn(" testDebugUnitTest" )
46
+ reports {
47
+ xml.required.set(true )
48
+ html.required.set(true )
49
+ html.outputLocation.set(file(" ${layout.buildDirectory} /reports/jacoco/html" ))
50
+ xml.outputLocation.set(file(" ${layout.buildDirectory} /reports/jacoco/xml/jacoco.xml" ))
51
+ }
52
+ sourceDirectories.setFrom(sourceDirectoriesTree)
53
+ classDirectories.setFrom(files(classDirectoriesTree))
54
+ executionData.setFrom(executionDataTree)
55
+ }
56
+ }
57
+
58
+ afterEvaluate {
59
+ project.tasks.getByName(" testDebugUnitTest" )
60
+ .finalizedBy(" jacocoDebugTestReport" )
61
+ }
0 commit comments