generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
635 lines (530 loc) · 21.1 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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
buildscript {
dependencies {
classpath("org.flywaydb:flyway-database-postgresql:10.21.0")
}
}
plugins {
id 'application'
id 'checkstyle'
id 'pmd'
id 'jacoco'
id 'idea'
id 'io.spring.dependency-management' version '1.1.6'
id 'org.springframework.boot' version '3.3.5'
id 'org.owasp.dependencycheck' version '11.1.0'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'org.sonarqube' version '5.1.0.4882'
id "io.freefair.lombok" version "8.10.2"
id "org.openapi.generator" version "7.9.0"
id "org.flywaydb.flyway" version "10.21.0"
id 'maven-publish'
id("com.dorongold.task-tree") version "4.0.0"
}
jacoco {
toolVersion = "0.8.12"
reportsDirectory.set(layout.buildDirectory.dir("jacocoHtml"))
}
group = 'uk.gov.hmcts'
version = '0.0.1'
compileJava {
sourceCompatibility = '21'
targetCompatibility = '21'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
//here we are going to store swagger files
def swaggerList = []
//iteration by swagger file root folder and save into swaggerList variable
def dir = new File("$rootDir/src/main/resources/openapi/".toString())
import java.nio.file.Files
import static groovy.io.FileType.FILES
dir.eachFileRecurse(FILES) { file ->
if (file.getName().endsWith(".yaml") && file.getName() != "problem.yaml")
swaggerList << file
}
def openApiGenerateTaskList = []
// Iterate on all swagger files and generate a task for each one with the nomenclature openApiGenerate + swagger name
swaggerList.each {
def apiName = it.getName().replace(".yaml", "");
def taskName = "openApiGenerate" + apiName.capitalize()
openApiGenerateTaskList << taskName
tasks.register(taskName, org.openapitools.generator.gradle.plugin.tasks.GenerateTask, {
generatorName = "spring"
inputSpec = "$rootDir/src/main/resources/openapi/".toString() + "${apiName}.yaml"
outputDir = "$buildDir/generated/openapi".toString()
apiPackage = "uk.gov.hmcts.darts.".toString() + "${apiName}" + ".http.api"
modelPackage = "uk.gov.hmcts.darts.".toString() + "${apiName}" + ".model"
// https://openapi-generator.tech/docs/generators/java/#config-options
skipOperationExample = true
openapiNormalizer = [
REF_AS_PARENT_IN_ALLOF: "true"
]
configOptions = [
dateLibrary : "java8",
interfaceOnly : "true",
useTags : "true",
useSpringBoot3 : "true",
containerDefaultToNull: "true"
]
})
}
sourceSets {
main {
java.srcDirs files("$buildDir/generated/openapi/src/main/java").builtBy(openApiGenerateTaskList)
}
testCommon {
java {
compileClasspath += main.output
runtimeClasspath += main.output
srcDir file('src/testCommon/java')
}
resources.srcDir file('src/testCommon/resources')
}
functionalTest {
java {
compileClasspath += main.output
runtimeClasspath += main.output
srcDir file('src/functionalTest/java')
}
resources.srcDir file('src/functionalTest/resources')
}
integrationTest {
java {
compileClasspath += main.output
compileClasspath += testCommon.output
runtimeClasspath += main.output
runtimeClasspath += testCommon.output
srcDir file('src/integrationTest/java')
}
resources.srcDir file('src/integrationTest/resources')
}
smokeTest {
java {
compileClasspath += main.output
runtimeClasspath += main.output
srcDir file('src/smokeTest/java')
}
resources.srcDir file('src/smokeTest/resources')
}
test {
java {
compileClasspath += main.output
compileClasspath += testCommon.output
runtimeClasspath += main.output
runtimeClasspath += testCommon.output
srcDir file('src/test/java')
}
resources.srcDir file('src/test/resources')
}
}
idea {
module {
testSources.from(sourceSets.integrationTest.allSource.srcDirs)
testResources.from(sourceSets.integrationTest.resources.srcDirs)
testSources.from(sourceSets.functionalTest.allSource.srcDirs)
testResources.from(sourceSets.functionalTest.resources.srcDirs)
testSources.from(sourceSets.smokeTest.allSource.srcDirs)
testResources.from(sourceSets.smokeTest.resources.srcDirs)
testSources.from(sourceSets.testCommon.allSource.srcDirs)
testResources.from(sourceSets.testCommon.resources.srcDirs)
}
}
configurations.configureEach {
exclude group: 'org.bouncycastle', module: 'bcprov-jdk18on' // bcprov-jdk18on-1.73.jar CVE-2023-33201
}
configurations {
testCommonImplementation.extendsFrom testImplementation
functionalTestImplementation.extendsFrom testImplementation
functionalTestRuntimeOnly.extendsFrom runtimeOnly
integrationTestImplementation.extendsFrom testCommonImplementation
integrationTestRuntimeOnly.extendsFrom runtimeOnly
smokeTestImplementation.extendsFrom testImplementation
smokeTestRuntimeOnly.extendsFrom runtimeOnly
openapispecifications
}
tasks.named('processTestResources', Copy) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-Xlint:unchecked" << "-Werror"
}
// https://github.com/gradle/gradle/issues/16791
tasks.withType(JavaExec).configureEach {
javaLauncher.set(javaToolchains.launcherFor(java.toolchain))
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
maxHeapSize = '1G'
testLogging {
exceptionFormat = 'full'
}
}
tasks.register('functional', Test) {
description = "Runs functional tests"
group = "Verification"
testClassesDirs = sourceSets.functionalTest.output.classesDirs
classpath = sourceSets.functionalTest.runtimeClasspath
}
tasks.register('integration', Test) {
description = "Runs integration tests"
group = "Verification"
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
}
tasks.register('smoke', Test) {
description = "Runs Smoke Tests"
testClassesDirs = sourceSets.smokeTest.output.classesDirs
classpath = sourceSets.smokeTest.runtimeClasspath
}
checkstyle {
maxWarnings = 0
checkstyleMain.exclude '**/uk/gov/hmcts/darts/task/runner/dailylist/**'
}
var sourceSetsCopy = sourceSets
pmd {
toolVersion = "7.7.0"
sourceSets = [sourceSetsCopy.main]
reportsDir = file("$project.buildDir/reports/pmd")
// https://github.com/pmd/pmd/issues/876
ruleSets = []
ruleSetFiles = files("config/pmd/main-ruleset.xml")
}
pmd {
toolVersion = "7.7.0"
sourceSets = [sourceSetsCopy.test, sourceSetsCopy.functionalTest, sourceSetsCopy.integrationTest, sourceSetsCopy.smokeTest]
reportsDir = file("$project.buildDir/reports/pmd")
// https://github.com/pmd/pmd/issues/876
ruleSets = []
ruleSetFiles = files("config/pmd/test-ruleset.xml")
}
def coverageExclusions = [
'**/uk/gov/hmcts/darts/common/entity/**',
'**/uk/gov/hmcts/darts/**/model/**',
'**/uk/gov/hmcts/darts/**/config/**',
'**/uk/gov/hmcts/darts/authentication/util/AuthenticationType.java',
'**/uk/gov/hmcts/darts/notification/NotificationConstants.java',
'**/uk/gov/hmcts/darts/cases/CasesConstants.java',
'**/uk/gov/hmcts/darts/cases/CasesConstants$GetCasesParams.java',
'**/uk/gov/hmcts/darts/cases/CasesConstants$GetSearchCasesParams.java',
'**/uk/gov/hmcts/darts/notification/NotificationConstants$ParameterMapValues.java',
'**/uk/gov/hmcts/darts/cases/api**',
'**/uk/gov/hmcts/darts/dailylist/api**',
'**/uk/gov/hmcts/darts/courthouse/api**',
'**/uk/gov/hmcts/darts/audio/api**',
'**/uk/gov/hmcts/darts/hearings/api**',
'**/uk/gov/hmcts/darts/audit/api**',
'**/uk/gov/hmcts/darts/event/api**',
'**/uk/gov/hmcts/darts/audiorequests/api**',
'**/uk/gov/hmcts/darts/casedocument/template**',
'**/uk/gov/hmcts/darts/log/api/impl/LogApiImpl.java'
]
jacocoTestReport {
executionData(test, integration)
reports {
xml.required = true
csv.required = false
html.outputLocation.set(layout.buildDirectory.dir("jacocoHtml"))
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: jacocoExclusionArray(coverageExclusions)
)
}))
}
}
static String[] jacocoExclusionArray(ArrayList<String> exclusions)
{
final def lst = new ArrayList<String>();
exclusions.stream().forEach {it.endsWith(".java") ? lst.add(it.replace(".java", ".class")) : lst.add(it)}
return lst.toArray();
}
tasks.jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = "0.8".toBigDecimal()
}
}
rule {
enabled = true
element = "CLASS"
includes = Arrays.asList(new String[] {"uk.gov.hmcts.darts.*"})
limit {
counter = "LINE"
value = "TOTALCOUNT"
maximum = "0.8".toBigDecimal()
}
}
}
}
project.tasks['sonarqube'].dependsOn jacocoTestReport
project.tasks['check'].finalizedBy integration
jacocoTestReport.dependsOn check
jacocoTestCoverageVerification.dependsOn jacocoTestReport
sonarqube {
properties {
property "sonar.projectName", "DARTS :: darts-api"
property "sonar.projectKey", "uk.gov.hmcts.reform:darts-api"
property "sonar.exclusions", coverageExclusions.join(', ')
property 'sonar.coverage.exclusions', "**/entity/*,**/dto/*,**/AzureCopyUtil.java,**/TestSupportController.java,**/darts/**"
//duplicate code here due to OpenAPI codegen that creates identical
// objects (Transcript) in different packages
property "sonar.cpd.exclusions", "**/TranscriptionMapper.java"
property "sonar.cpd.exclusions", "**/ManualTaskService.java"
property "sonar.scm.exclusions", "**/ManualTaskService.java"
}
}
// before committing a change, make sure task still works
dependencyUpdates {
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { qualifier -> version.toUpperCase().contains(qualifier) }
def regex = /^[0-9,.v-]+$/
return !stableKeyword && !(version ==~ regex)
}
rejectVersionIf { selection -> // <---- notice how the closure argument is named
return isNonStable(selection.candidate.version) && !isNonStable(selection.currentVersion)
}
}
// https://jeremylong.github.io/DependencyCheck/dependency-check-gradle/configuration.html
dependencyCheck {
// Specifies if the build should be failed if a CVSS score above a specified level is identified.
// range of 0-10 fails the build, anything greater and it doesn't fail the build
failBuildOnCVSS = 0
suppressionFile = 'config/owasp/suppressions.xml'
analyzers {
// Disable scanning of .NET related binaries
assemblyEnabled = false
}
skipConfigurations = [
"compileOnly",
"pmd",
"integrationTest",
"functionalTest",
"smokeTest",
"contractTestRuntimeClasspath",
"contractTestCompileClasspath"
]
}
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'https://repo.spring.io/milestone/'}
}
ext {
log4JVersion = "2.24.1"
tomcatEmbedVersion = "10.1.33"
}
ext['snakeyaml.version'] = '2.0'
ext['spring-security.version'] = '6.0.7' // https://spring.io/security/cve-2023-20862
ext["jackson-bom.version"] = "2.16.0"
dependencies {
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-oauth2-client'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-aop'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-json'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-security'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-cache'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis'
implementation group: 'org.springframework', name: 'spring-webflux', version: '6.1.14'
implementation group: 'org.springframework.security', name: 'spring-security-oauth2-authorization-server', version: '1.3.3'
implementation group: 'commons-io', name: 'commons-io', version: '2.17.0'
implementation 'org.apache.commons:commons-collections4:4.4'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0'
implementation 'commons-validator:commons-validator:1.9.0'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'javax.validation:validation-api:2.0.1.Final'
compileOnly 'javax.servlet:servlet-api:2.5'
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
implementation 'org.zalando:problem-spring-web-starter:0.29.1'
implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: '2.6.0'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-openfeign', version: '4.1.3'
implementation 'org.springframework.retry:spring-retry:2.0.10'
implementation 'net.javacrumbs.shedlock:shedlock-spring:5.16.0'
implementation 'net.javacrumbs.shedlock:shedlock-provider-jdbc-template:5.16.0'
implementation group: 'com.github.hmcts.java-logging', name: 'logging', version: '6.1.7'
implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: log4JVersion
implementation group: 'org.apache.logging.log4j', name: 'log4j-to-slf4j', version: log4JVersion
implementation group: 'org.apache.commons', name: 'commons-exec', version: '1.4.0'
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.12.0'
//CVE-2023-44487
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: tomcatEmbedVersion
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-websocket', version: tomcatEmbedVersion
implementation platform('com.azure:azure-sdk-bom:1.2.29')
implementation 'com.azure:azure-storage-blob'
implementation group: 'io.rest-assured', name: 'rest-assured'
implementation group: 'org.flywaydb', name: 'flyway-core', version: '10.21.0'
implementation group: 'org.flywaydb', name: 'flyway-database-postgresql', version: '10.21.0'
implementation group: 'io.hypersistence', name: 'hypersistence-utils-hibernate-63', version: '3.9.0'
//database
implementation 'org.postgresql:postgresql:42.7.4'
implementation 'uk.gov.service.notify:notifications-java-client:5.2.1-RELEASE'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.5.12'
implementation group: 'ch.qos.logback', name: 'logback-core', version: '1.5.12'
implementation group: 'io.vavr', name: 'vavr', version: '0.10.5'
implementation group: 'com.google.guava', name: 'guava', version: '33.3.1-jre'
implementation 'org.mapstruct:mapstruct:1.6.3'
implementation group: 'org.apache.tika', name: 'tika-core', version: '3.0.0'
implementation group: 'org.springframework.data', name: 'spring-data-envers', version: '3.3.5'
implementation 'org.hibernate.orm:hibernate-ant:6.6.2.Final'
implementation 'org.hibernate:hibernate-spatial:6.6.2.Final'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.6.3'
annotationProcessor('org.hibernate.orm:hibernate-jpamodelgen:6.6.2.Final')
// Added to resolve issue where the default Feign client will silently convert GET requests to POST if the request contains a body
// Ref: https://github.com/spring-cloud/spring-cloud-openfeign/issues/832
implementation group: 'io.github.openfeign', name: 'feign-hc5', version: '13.5'
testImplementation 'org.testcontainers:postgresql:1.20.3'
testImplementation 'com.h2database:h2:2.3.232'
testImplementation group: 'org.postgresql', name: 'postgresql', version: '42.7.4'
testImplementation 'org.mockito:mockito-inline:5.2.0'
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', {
exclude group: 'junit', module: 'junit'
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
}
testImplementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-contract-stub-runner', version: '4.1.4'
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.3'
testImplementation group: 'io.projectreactor', name: 'reactor-test', version: '3.7.0'
testImplementation 'org.springframework.security:spring-security-test:6.3.4'
// https://mvnrepository.com/artifact/org.awaitility/awaitility
testImplementation group: 'org.awaitility', name: 'awaitility', version: '4.2.2'
// https://mvnrepository.com/artifact/org.awaitility/awaitility-proxy
testImplementation group: 'org.awaitility', name: 'awaitility-proxy', version: '3.1.6'
testImplementation 'io.github.hakky54:logcaptor:2.9.3'
testImplementation 'org.testcontainers:testcontainers:1.20.3'
testImplementation group: 'org.jeasy', name: 'easy-random-core', version: '5.0.0'
compileJava.dependsOn = openApiGenerateTaskList
}
dependencyManagement {
dependencies {
// Resolves CVE-2023-44487 - remove this block once azure-storage-blob pulls in latest version of netty
dependencySet(group: 'io.netty', version: '4.1.115.Final') {
entry 'netty-buffer'
entry 'netty-codec'
entry 'netty-codec-dns'
entry 'netty-codec-http'
entry 'netty-codec-http2'
entry 'netty-codec-socks'
entry 'netty-common'
entry 'netty-handler'
entry 'netty-handler-proxy'
entry 'netty-resolver'
entry 'netty-resolver-dns'
entry 'netty-resolver-dns-classes-macos'
entry 'netty-resolver-dns-native-macos'
entry 'netty-transport'
entry 'netty-transport-classes-epoll'
entry 'netty-transport-classes-kqueue'
entry 'netty-transport-native-epoll'
entry 'netty-transport-native-kqueue'
entry 'netty-transport-native-unix-common'
}
//temporary fix for vulnerability https://spring.io/security/cve-2023-34062
dependencySet(group: 'io.projectreactor.netty', version: '1.2.0') {
entry 'reactor-netty-http'
entry 'reactor-netty-core'
}
}
}
mainClassName = 'uk.gov.hmcts.darts.Application'
bootJar {
archiveFileName = "darts-api.jar"
manifest {
attributes('Implementation-Version': project.version.toString())
}
}
// Gradle 7.x issue, workaround from: https://github.com/gradle/gradle/issues/17236#issuecomment-894768083
rootProject.tasks.named("processSmokeTestResources") {
duplicatesStrategy = 'include'
}
rootProject.tasks.named("processFunctionalTestResources") {
duplicatesStrategy = 'include'
}
rootProject.tasks.named("processIntegrationTestResources") {
duplicatesStrategy = 'include'
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}
flyway {
url = System.getenv('FLYWAY_URL')
println "FLYWAY url=${url}"
user = System.getenv('FLYWAY_USER')
password = System.getenv('FLYWAY_PASSWORD')
schemas = ['darts']
println "FLYWAY schemas=${schemas}"
baselineOnMigrate = true
baselineVersion = '000'
locations = ["db/migration/common", "db/migration/postgres"]
// change to false to allow flyway clean to be run
cleanDisabled = true
}
// this can be run to clean the DB down allowing from a fresh migration from scratch
tasks.register('cleanPostgresDatabase', org.flywaydb.gradle.task.FlywayCleanTask) {
if (project.hasProperty("dburl")) {
url = "jdbc:postgresql://${dburl}"
}
}
tasks.register('migratePostgresDatabase', org.flywaydb.gradle.task.FlywayMigrateTask) {
baselineOnMigrate = true
if (project.hasProperty("dburl")) {
url = "jdbc:postgresql://${dburl}"
}
}
// Add a new jar that will be published to maven with the classifier -openapi
tasks.register('openapiJar', Jar) {
archiveClassifier = 'openapi'
from layout.buildDirectory.dir("processedSpecs").get().asFile
}
artifacts.add('openapispecifications', openapiJar)
publishing {
publications {
maven(MavenPublication) {
artifact openapiJar
}
}
}
tasks.register('updateOpenSpecificationsWithVersion') {
doLast {
def fileDir = "$projectDir/src/main/resources/openapi/"
File openFile = new File(fileDir)
for (File file : openFile.listFiles()) {
def fileName = file.getName()
def contents = Files.readString(file.toPath())
def response = contents.replace("\044{version}", version)
File newOASFile = layout.buildDirectory.dir("processedSpecs").get().asFile;
newOASFile.mkdirs();
def newFile = new File(newOASFile.absolutePath + File.separator + fileName)
println(fileName);
if (!newFile.exists()) {
newFile.createNewFile();
}
newFile.withWriter('utf-8') {
writer -> writer.writeLine response
}
}
}
}
task runAllStyleChecks {
dependsOn 'checkstyleMain'
dependsOn 'checkstyleTest'
dependsOn 'checkstyleIntegrationTest'
dependsOn 'checkstyleSmokeTest'
dependsOn 'checkstyleFunctionalTest'
dependsOn 'checkstyleTestCommon'
dependsOn 'pmdMain'
dependsOn 'pmdTest'
dependsOn 'pmdIntegrationTest'
dependsOn 'pmdSmokeTest'
dependsOn 'pmdFunctionalTest'
dependsOn 'pmdTestCommon'
}
// set flyway cleanDisabled to true above and uncomment if we require a fresh migration from scratch across all DBs
// migratePostgresDatabase.dependsOn cleanPostgresDatabase
processResources.dependsOn updateOpenSpecificationsWithVersion
assemble.dependsOn openapiJar