-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
62 lines (52 loc) · 1.74 KB
/
build.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
gradlePluginPortal()
mavenCentral()
jcenter()
}
}
plugins {
id 'net.saliman.cobertura' version '2.3.1'
id 'com.github.kt3k.coveralls' version '2.8.2'
id 'jacoco'
}
allprojects {
repositories {
jcenter()
}
}
// Code Coverage and reporting.
// The coveralls gradle plugin cannot handle multiple projects, so we have to flatten
// the reports here in order to get coverage for all subprojects.
def publishedProjects = subprojects.findAll {
(it.path == ':winston-libs') || (it.path == ':winston-server')
}
evaluationDependsOn(':winston-libs')
evaluationDependsOn(':winston-server')
task jacocoMerge(type: JacocoMerge) {
publishedProjects.each { subproject ->
executionData subproject.tasks.withType(Test)
}
doFirst {
executionData = files(executionData.findAll { it.exists() })
}
}
// Collect reports from subprojects to be submitted to coveralls.io.
task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') {
description = 'Generates an aggregate report from all subprojects'
dependsOn publishedProjects.test, jacocoMerge
sourceDirectories = files(publishedProjects.sourceSets.main.allSource.srcDirs)
classDirectories = files(publishedProjects.sourceSets.main.output)
executionData = files(publishedProjects.jacocoTestReport.executionData)
reports {
html.enabled = true // human readable
xml.enabled = true // required by coveralls
}
}
coveralls {
sourceDirs = files(publishedProjects.sourceSets.main.allSource.srcDirs).files.absolutePath
}
tasks.coveralls {
dependsOn jacocoRootReport
}