|
@@ -1,34 +1,12 @@
|
1
|
1
|
apply plugin: 'jacoco'
|
2
|
|
-apply plugin: 'com.github.kt3k.coveralls'
|
3
|
2
|
|
4
|
|
-task jacocoRootReport(type: JacocoReport, group: 'Coverage reports', dependsOn: subprojects.test) {
|
5
|
|
- description = 'Generates an aggregate report from all subprojects'
|
6
|
|
-
|
7
|
|
- additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs)
|
8
|
|
- sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
|
9
|
|
- classDirectories = files(subprojects.sourceSets.main.output)
|
10
|
|
- executionData = files(subprojects.jacocoTestReport.executionData)
|
|
3
|
+jacocoTestReport {
|
|
4
|
+ group = 'Coverage reports'
|
|
5
|
+ description = 'Generates a test coverage report for a project'
|
11
|
6
|
|
12
|
7
|
reports {
|
13
|
|
- html.enabled = true
|
14
|
8
|
xml.enabled = true
|
|
9
|
+ html.enabled = true
|
15
|
10
|
}
|
16
|
|
-
|
17
|
|
- doFirst {
|
18
|
|
- executionData = files(executionData.findAll { it.exists() })
|
19
|
|
- }
|
20
|
|
-}
|
21
|
|
-
|
22
|
|
-coveralls {
|
23
|
|
- jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
|
24
|
|
- subprojects.sourceSets.main.allSource.srcDirs*.path.each { sourceDirs.addAll(it) }
|
25
|
|
-}
|
26
|
|
-
|
27
|
|
-tasks.coveralls {
|
28
|
|
- group = 'Coverage reports'
|
29
|
|
- description = 'Uploads the aggregated coverage report to Coveralls'
|
30
|
|
-
|
31
|
|
- dependsOn jacocoRootReport
|
32
|
|
- onlyIf { System.env.'CI' }
|
33
|
11
|
}
|
34
|
12
|
|