-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
226 lines (184 loc) · 6.24 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
plugins {
id 'checkstyle'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.springframework.boot' version '3.4.0'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'java-library'
id 'maven-publish'
}
apply plugin: 'idea'
def buildNumber = System.getenv("RELEASE_VERSION")?.replace("refs/tags/", "") ?: "DEV-SNAPSHOT"
group 'uk.gov.hmcts.reform'
version buildNumber
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
configurations {
aatImplementation.extendsFrom(testImplementation)
aatRuntimeOnly.extendsFrom(testRuntimeOnly)
}
sourceSets {
aat {
java {
compileClasspath += main.output
runtimeClasspath += main.output
}
}
test {
java.srcDir 'src/test/java'
}
}
checkstyle {
maxWarnings = 0
toolVersion = '10.21.0'
// need to set configDir to rootDir otherwise submodule will use submodule/config/checkstyle
getConfigDirectory().set(new File(rootDir, 'config/checkstyle'))
}
compileJava {
options.compilerArgs << '-parameters' << '-Xlint:deprecation'
}
compileTestJava {
options.compilerArgs << '-Xlint:deprecation'
}
repositories {
mavenCentral()
mavenLocal()
maven { url 'https://jitpack.io' }
}
jar {
manifest {
attributes 'Implementation-Title': project.name, 'Implementation-Version': project.version
}
}
task printVersion {
doLast {
print project.version
}
}
def gitRepo = "https://github.com/hmcts/em-test-helper"
def pomConfig = {
licenses {
license {
name "MIT License"
url "http://www.opensource.org/licenses/mit-license.php"
distribution "repo"
}
}
scm {
url "https://github.com/hmcts/em-test-helper"
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
publishing {
publications {
Main(MavenPublication) {
from components.java
artifact sourcesJar
groupId project.group
artifactId 'em-test-helper'
version project.version
pom.withXml {
def root = asNode()
root.appendNode('description', 'Em Test Helper')
root.appendNode('name', 'Em Test Helper')
root.appendNode('url', gitRepo)
root.children().last() + pomConfig
}
}
}
}
ext {
lombokVersion = '1.18.36'
feignVersion = '13.5'
feignFormVersion = '3.8.0'
wiremockVersion = '2.24.1'
junitJupiterVersion = '5.11.4'
}
ext["spring-cloud-openfeign.version"] = "3.0.3"
dependencies {
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-bootstrap', version: '4.2.0'
api "com.github.hmcts:idam-java-client:3.0.3"
api "com.github.hmcts:ccd-client:5.0.3"
api "com.github.hmcts:document-management-client:7.0.1"
api 'com.github.hmcts:ccd-case-document-am-client:1.59'
implementation group: 'com.warrenstrange', name: 'googleauth', version: '1.5.0'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign', version: '4.2.0'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
implementation group: 'io.github.openfeign', name: 'feign-jackson', version: feignVersion
implementation group: 'io.github.openfeign', name: 'feign-httpclient', version: feignVersion
implementation group: 'io.github.openfeign.form', name: 'feign-form', version: feignFormVersion
implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: '2.15.2'
implementation group: 'org.projectlombok', name: 'lombok', version: lombokVersion
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: lombokVersion
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitJupiterVersion
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitJupiterVersion
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-bootstrap', version: '4.2.0'
testImplementation group: 'com.github.tomakehurst', name:'wiremock-jre8', version: '3.0.1'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.14.2'
testImplementation group: 'org.springframework.cloud', name: 'spring-cloud-contract-wiremock', version: '4.1.0'
implementation group: 'junit', name: 'junit', version: '4.13.2'
}
dependencyManagement {
dependencies {
dependencySet(group: 'org.apache.logging.log4j', version: '2.24.3') {
entry 'log4j-api'
entry 'log4j-to-slf4j'
}
dependencySet(group: 'org.junit.platform', version: '1.11.4') {
entry 'junit-platform-commons'
}
}
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
// https://github.com/gradle/gradle/issues/16791
tasks.withType(JavaExec).configureEach {
javaLauncher.set(javaToolchains.launcherFor(java.toolchain))
}
test {
useJUnitPlatform()
}
bootJar {
archiveClassifier = 'boot'
enabled = false
}
jar {
archiveClassifier = ''
enabled = true
}
idea {
module {
testSourceDirs += project.sourceSets.aat.java.srcDirs
testResourceDirs += project.sourceSets.aat.resources.srcDirs
}
}
task functional(type: Test) {
group = 'Delivery pipeline'
description = 'Executes functional tests'
setTestClassesDirs(sourceSets.aat.output.classesDirs)
setClasspath(sourceSets.aat.runtimeClasspath)
include "uk/gov/hmcts/reform/em/functional/**"
}