This repository has been archived by the owner on Mar 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
232 lines (192 loc) · 7.13 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
import java.util.stream.Collectors
buildscript {
dependencies {
classpath group: 'org.sonarsource.scanner.gradle', name: 'sonarqube-gradle-plugin', version: '2.6.2'
classpath("net.serenity-bdd:serenity-gradle-plugin:2.0.11")
}
}
plugins {
id 'application'
id 'pmd'
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'org.owasp.dependencycheck' version '5.0.0'
id 'com.github.ben-manes.versions' version '0.20.0'
id 'com.gorylenko.gradle-git-properties' version '1.5.2'
id 'info.solidsoft.pitest' version '1.3.0'
}
apply plugin: 'org.sonarqube'
apply plugin: 'findbugs'
apply plugin: 'jacoco'
apply plugin: 'net.serenity-bdd.aggregator'
apply from: 'liquibase.gradle'
gitProperties {
gitPropertiesDir = new File("${project.rootDir}/src/main/resources/uk/gov/hmcts/probate/services/persistence")
keys = ['git.commit.id','git.commit.time']
dateFormat = "yyyy-MM-dd'T'HH:mmZ"
dateFormatTimeZone = "GMT"
}
group = 'uk.gov.hmcts.probate'
version = "4.1.0"
mainClassName = 'uk.gov.hmcts.probate.services.persistence.Application'
sourceCompatibility = 1.8
targetCompatibility = 1.8
//check.dependsOn dependencyCheckAnalyze
jacoco {
toolVersion = '0.8.0'
}
jacocoTestReport {
group = "Reporting"
reports {
xml.enabled false
html.destination "${buildDir}/reports/jacoco"
}
}
tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}
findbugs{
ignoreFailures=true
reportLevel = "low"
}
sonarqube {
properties {
property "sonar.exclusions", "**/*.java"
property "sonar.projectName", "Probate :: Persistence Service"
property "sonar.jacoco.reportPath", "${project.buildDir}/jacoco/test.exec"
property "sonar.host.url", "https://sonar.reform.hmcts.net/"
property "sonar.pitest.mode", "reuseReport"
property "sonar.pitest.reportsDirectory", "build/reports/pitest"
}
}
test.finalizedBy jacocoTestReport
dependencyCheck {
failBuildOnCVSS = System.getProperty('dependencyCheck.failBuild') == 'true' ? 0 : 11
suppressionFile = 'config/owasp/suppressions.xml'
scanConfigurations = ['compile']
analyzers {
// Disable scanning of .NET related binaries
assemblyEnabled = false
}
}
sourceSets {
testSmoke {
java {
compileClasspath += main.output
runtimeClasspath += main.output
srcDir file('src/smokeTest/java')
}
resources.srcDir file('src/smokeTest/resources')
}
testFunctional {
java {
compileClasspath += main.output
runtimeClasspath += main.output
srcDir file('src/functionalTest/java')
}
resources.srcDir file('src/functionalTest/resources')
}
}
task smoke(type: Test) {
description = "Runs Smoke Tests"
testClassesDirs = sourceSets.testSmoke.output.classesDirs
classpath = sourceSets.testSmoke.runtimeClasspath
}
task functional(type: Test) {
description = "Runs functional Tests"
testClassesDirs = sourceSets.testFunctional.output.classesDirs
classpath = sourceSets.testFunctional.runtimeClasspath
finalizedBy aggregate
}
pmd {
toolVersion = "6.3.0"
ignoreFailures = true
sourceSets = [sourceSets.main, sourceSets.test, sourceSets.testFunctional, sourceSets.testSmoke]
reportsDir = file("$project.buildDir/reports/pmd")
ruleSetFiles = files("config/pmd/ruleset.xml")
}
jacocoTestReport {
executionData(test)
reports {
xml.enabled = true
csv.enabled = false
xml.destination = file("${project.buildDir}/reports/jacoco/test/jacocoTestReport.xml")
}
}
pitest {
targetClasses = ['uk.gov.hmcts.probate.*']
threads = 4
outputFormats = ['XML', 'HTML']
timestampedReports = false
mutationThreshold = 30
}
repositories {
mavenLocal()
maven { url "https://dl.bintray.com/hmcts/hmcts-maven" }
maven { url 'https://repo.spring.io/libs-milestone' }
}
processResources {
from ('src/lib/AI-Agent.xml') {
into 'lib'
}
}
def versions = [
reformsJavaLoggingVersion: '3.0.4',
springBootVersion: '2.0.7.RELEASE',
serenityVersion: '2.0.30',
]
dependencies {
compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version: versions.springBootVersion
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-rest', version: versions.springBootVersion
compile group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: versions.springBootVersion
compile ("com.fasterxml.jackson.core:jackson-databind:2.9.9.3") {
force = true
}
compile ('org.postgresql:postgresql:42.2.2') {
exclude module: 'slf4j-simple'
}
compile group: 'org.liquibase', name: 'liquibase-core', version: '3.6.2'
compile group: 'uk.gov.hmcts.reform', name: 'java-logging', version: versions.reformsJavaLoggingVersion
compile group: 'uk.gov.hmcts.reform', name: 'java-logging-appinsights', version: versions.reformsJavaLoggingVersion
compile group: 'uk.gov.hmcts.reform', name: 'java-logging-httpcomponents', version: versions.reformsJavaLoggingVersion
compile group: 'org.springframework.hateoas', name: 'spring-hateoas'
testCompile group: 'org.pitest', name: 'pitest', version: '1.3.2'
testCompile 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.3.0'
testCompile 'org.codehaus.sonar-plugins:sonar-pitest-plugin:0.5'
testCompile group: 'com.google.code.findbugs', name: 'findbugs', version: '3.0.1'
testCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: versions.springBootVersion
testCompile group: 'com.h2database', name: 'h2', version: '1.4.197'
testCompile group: 'io.rest-assured', name: 'rest-assured', version: '3.0.7'
testFunctionalCompile group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: versions.springBootVersion
testFunctionalCompile group: 'net.serenity-bdd', name: 'serenity-junit', version: versions.serenityVersion
testFunctionalCompile group: 'net.serenity-bdd', name: 'serenity-core', version: versions.serenityVersion
testFunctionalCompile group: 'net.serenity-bdd', name: 'serenity-rest-assured', version: versions.serenityVersion
testFunctionalCompile group: 'net.serenity-bdd', name: 'serenity-spring', version: versions.serenityVersion
testFunctionalCompile group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.1'
testFunctionalCompile group: 'org.apache.commons', name: 'commons-lang3', version: '3.8.1'
testFunctionalCompile sourceSets.main.runtimeClasspath
testSmokeCompile sourceSets.main.runtimeClasspath
testSmokeCompile sourceSets.test.runtimeClasspath
}
compileJava {
options.compilerArgs << '-parameters'
}
bootJar {
archiveName = 'persistence-service.jar'
manifest {
attributes 'Implementation-Title': project.name,
'Implementation-Version': project.version
}
}
task printVersion {
doLast {
print project.version
}
}
run {
if (debug == 'true') {
jvmArgs = ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005']
}
}