This repository has been archived by the owner on Mar 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
129 lines (111 loc) · 3.8 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
import java.util.function.Predicate
plugins {
id 'java'
id 'org.springframework.boot' version '3.0.3'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.graalvm.buildtools.native' version '0.9.18'
id 'jacoco'
id "org.sonarqube" version "3.5.0.2730"
}
group = 'it.pagopa.gov'
version = '1.0.0'
sourceCompatibility = '17'
ext {
set('testcontainersVersion', "1.17.6")
set('springCloudVersion', "2022.0.1")
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.cloud:spring-cloud-stream'
implementation 'org.springframework.cloud:spring-cloud-stream-binder-kafka'
implementation 'org.springframework.kafka:spring-kafka'
implementation 'org.apache.httpcomponents:httpclient:4.5.14'
// fp library -> docs: https://docs.vavr.io/#_introduction
implementation 'io.vavr:vavr:0.10.4'
implementation 'io.reactivex.rxjava3:rxjava:3.1.6'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.mockito:mockito-inline:5.1.1'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.cloud:spring-cloud-stream-test-binder'
testImplementation 'org.springframework.kafka:spring-kafka-test'
// test containers
testImplementation "org.testcontainers:testcontainers"
testImplementation "org.testcontainers:junit-jupiter"
testImplementation "org.testcontainers:mongodb"
testImplementation "org.testcontainers:kafka"
testImplementation 'org.awaitility:awaitility:4.2.0'
}
dependencyManagement {
imports {
mavenBom "org.testcontainers:testcontainers-bom:${testcontainersVersion}"
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
xml.required = true
xml.destination file("${buildDir}/reports/jacoco.xml")
}
}
sonarqube {
properties {
property "sonar.exclusions", "**/it.pagopa.gov.rtdmsexporter.ports.rest/**"
}
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
task testWithAgent(type: Test) {
// GRAALVM_HOME must be set
useJUnitPlatform()
finalizedBy(metadataCopy)
}
graalvmNative {
// Agent useful to get working with external libraries.
// It allows to get additional reflection metadata, by default is run with test task
// the metadata must be copied to META-INF/native-image as resource
agent {
defaultMode = "standard"
enabled = true
metadataCopy {
inputTaskNames.add("testWithAgent")
outputDirectories.add("src/main/resources/META-INF/native-image")
mergeWithExisting = true
}
//callerFilterFiles.from("src/main/resources/native-filter/access-filter.json")
tasksToInstrumentPredicate = { t -> (t.name == "testWithAgent") } as Predicate<Task>
}
binaries {
main {
useFatJar = true
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
vendor = JvmVendorSpec.matching("GraalVM Community")
}
}
}
}
// disable processAot until https://github.com/spring-cloud/spring-cloud-stream/issues/2655 was fix
tasks.named("processAot") {
configure {
enabled = false
}
}
tasks.named("processTestAot") {
configure {
enabled = false
}
}