-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
118 lines (101 loc) · 2.76 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
buildscript {
ext {
springBootVersion = '2.2.0.RELEASE'
junitVersion = '5.3.2'
springFoxVersion = '2.9.2'
}
}
plugins {
id 'org.shipkit.java' version '2.0.31'
}
allprojects {
apply plugin: 'jacoco'
apply plugin: 'idea'
group = 'uk.gov.dhsc.htbhf'
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven {
url "https://dl.bintray.com/departmentofhealth-htbhf/maven"
}
}
jacoco {
toolVersion = "0.8.2"
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
sourceCompatibility = 1.11
targetCompatibility = 1.11
test {
reports {
junitXml.enabled = true
html.enabled = true
}
}
jacocoTestReport {
additionalSourceDirs.from(files(sourceSets.main.allSource.srcDirs))
sourceDirectories.from(files(sourceSets.main.allSource.srcDirs))
classDirectories.from(files(sourceSets.main.output))
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
}
task updateConfig() {
'git submodule update --init --recursive --remote'.execute()
}
tasks.check.dependsOn updateConfig
}
task jacocoReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
dependsOn = subprojects.test
additionalSourceDirs.from(files(subprojects.sourceSets.main.allSource.srcDirs))
sourceDirectories.from(files(subprojects.sourceSets.main.allSource.srcDirs))
classDirectories.from(files(subprojects.sourceSets.main.output))
executionData.from(files(subprojects.jacocoTestReport.executionData))
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
}
onlyIf = {
true
}
doFirst {
executionData = files(executionData.findAll {
it.exists()
})
}
}
task testReport(type: TestReport) {
destinationDir = file("$buildDir/reports/tests")
// Include the results from the `test` task in all subprojects
reportOn subprojects*.test
}
def testCounter = 0
allprojects {
tasks.withType(Test) {
afterSuite { testDescriptor, testResult ->
testCounter += testResult.testCount
}
}
}
task copyApiReports(type: Copy) {
from(file('api/build/reports'))
into(file('build/reports'))
outputs.upToDateWhen { false }
}
task copyAdditionalDocumentation(type: Copy) {
from(file('src/documentation/gh-pages'))
into(file('build/reports'))
}
task copySmokeTestReports(type: Copy) {
from(file('smoke_tests/build/reports/tests/test'))
into(file('build/reports/smoke_tests'))
}
task copyReports() {
dependsOn copyApiReports, copyAdditionalDocumentation, copySmokeTestReports
}