forked from DepartmentOfHealth-htbhf/htbhf-java-common
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
119 lines (100 loc) · 2.76 KB
/
Copy pathbuild.gradle
File metadata and controls
119 lines (100 loc) · 2.76 KB
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
119
buildscript {
ext {
springVersion = '5.2.1.RELEASE'
springBootVersion = '2.2.0.RELEASE'
junitVersion = '5.3.2'
spotbugsFindsecVersion = '1.9.0'
pluginGuavaVersion = '27.0.1-jre'
jacksonVersion = '2.10.0'
}
repositories {
jcenter()
mavenCentral()
}
}
plugins {
id 'org.shipkit.java' version '2.2.5'
}
allprojects {
apply plugin: 'jacoco'
apply plugin: 'idea'
group = 'uk.gov.dhsc.htbhf'
repositories {
jcenter()
}
jacoco {
toolVersion = "0.8.2"
}
}
subprojects {
apply plugin: 'java-library'
apply plugin: 'jacoco'
apply plugin: 'maven-publish' // allows us to run gradle publishToMavenLocal
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 copyCommonRestReports(type: Copy) {
from(file('common_rest/build/reports'))
into(file('build/reports'))
outputs.upToDateWhen { false }
}
task copyAdditionalDocumentation(type: Copy) {
from(file('src/documentation/gh-pages'))
into(file('build/reports'))
}
task copyReports() {
dependsOn copyCommonRestReports, copyAdditionalDocumentation
}