|
@@ -0,0 +1,34 @@
|
|
1
|
+apply plugin: 'jacoco'
|
|
2
|
+apply plugin: 'com.github.kt3k.coveralls'
|
|
3
|
+
|
|
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)
|
|
11
|
+
|
|
12
|
+ reports {
|
|
13
|
+ html.enabled = true
|
|
14
|
+ xml.enabled = true
|
|
15
|
+ }
|
|
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
|
+}
|
|
34
|
+
|