-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
107 lines (95 loc) · 3.44 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
plugins {
id "com.github.ben-manes.versions" version "0.51.0"
id "org.springframework.boot" version "3.4.0"
id "io.spring.dependency-management" version "1.1.6"
id "io.freefair.lombok" version "8.11"
id "org.graalvm.buildtools.native" version "0.10.3"
id "java"
id "jacoco"
}
group = "tech.sledger"
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(23))
}
}
repositories { mavenCentral() }
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << "-parameters" // << "-Xlint:unchecked" << "-Werror"
}
def testContainersVersion = "1.20.4"
configurations { mockitoAgent }
dependencies {
implementation "org.springframework.boot:spring-boot-starter-web"
implementation "org.springframework.boot:spring-boot-starter-security"
implementation "org.springframework.boot:spring-boot-starter-data-mongodb"
implementation "org.springframework.boot:spring-boot-starter-validation"
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "com.resend:resend-java:4.0.0"
implementation "org.bouncycastle:bcprov-jdk18on:1.79"
implementation "com.auth0:java-jwt:4.4.0"
implementation ("com.opencsv:opencsv:5.9") {
exclude group: "commons-logging", module: "commons-logging"
}
implementation "org.apache.poi:poi:5.3.0"
developmentOnly "org.springframework.boot:spring-boot-devtools"
testRuntimeOnly "org.mockito:mockito-inline:+"
testRuntimeOnly "org.junit.platform:junit-platform-launcher:1.11.3"
testImplementation "org.junit.jupiter:junit-jupiter:5.11.3"
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation "org.springframework.security:spring-security-test"
testImplementation "org.testcontainers:testcontainers:$testContainersVersion"
testImplementation "org.testcontainers:junit-jupiter:$testContainersVersion"
testImplementation "org.testcontainers:mongodb:$testContainersVersion"
runtimeOnly "io.projectreactor:reactor-core:3.7.0" // remove when spring boot updated
mockitoAgent 'org.mockito:mockito-core'
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
jvmArgs("-javaagent:${configurations.mockitoAgent.first()}")
}
test {
testLogging {
events "failed"
exceptionFormat "full"
}
reports {
junitXml.required = false
html.required = false
}
finalizedBy jacocoTestReport
}
jacocoTestReport {
dependsOn test
afterEvaluate {
getClassDirectories().setFrom(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"tech/sledger/*.class",
"tech/sledger/model/**",
"tech/sledger/service/ResendService.class",
"tech/sledger/config/AotHints.class"
])
})
}
reports {
xml.required = true
html.outputLocation = layout.buildDirectory.dir("jacocoHtml")
}
}
tasks.named("jar") { enabled = false }
bootBuildImage {
imageName = System.getenv("IMAGE_NAME") ?: "sledger-backend"
publish = System.getenv("DOCKER_PASS") != null
createdDate = "now"
environment = [
"BP_JVM_VERSION": "23",
"BP_SPRING_CLOUD_BINDINGS_DISABLED": "true",
"BP_NATIVE_IMAGE_BUILD_ARGUMENTS": "-H:+AddAllCharsets"
]
docker {
publishRegistry {
username = System.getenv("DOCKER_USER")
password = System.getenv("DOCKER_PASS")
}
}
}