-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle
75 lines (62 loc) · 1.91 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'fr.bmartel:gradle-javacard:1.5.6'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.1'
}
}
allprojects {
apply plugin: 'base'
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
repositories {
jcenter()
}
jacoco {
toolVersion = '0.7.9'
}
}
subprojects {
apply plugin: 'java'
test {
systemProperty 'testMode', System.getProperty("testMode") ?: 'simulator'
include '**/TestSuite.class'
outputs.upToDateWhen { false }
testLogging {
//showStandardStreams = true
exceptionFormat = 'full'
}
}
}
def publishedProjects = subprojects
task jacocoMerge(type: JacocoMerge) {
publishedProjects.each { subproject ->
executionData subproject.tasks.withType(Test)
}
doFirst {
executionData = files(executionData.findAll { it.exists() })
}
}
task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') {
description = 'Generates an aggregate report from all subprojects'
dependsOn publishedProjects.test, jacocoMerge
additionalSourceDirs = files(publishedProjects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(publishedProjects.sourceSets.main.allSource.srcDirs)
classDirectories = files(publishedProjects.sourceSets.main.output)
executionData jacocoMerge.destinationFile
reports {
html.enabled = true // human readable
xml.enabled = true // required by coveralls
}
}
coveralls {
sourceDirs = publishedProjects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml"
}
tasks.coveralls {
group = 'Coverage reports'
description = 'Uploads the aggregated coverage report to Coveralls'
dependsOn jacocoRootReport
}