-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
102 lines (89 loc) · 3.45 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id 'java'
id 'jacoco'
id 'com.adarshr.test-logger' version '4.0.+'
id 'io.freefair.lombok' version '8.+'
id 'io.spring.dependency-management' version '1.1.+'
id "org.jetbrains.kotlin.jvm" version "2.0.+"
id 'org.springframework.boot' version '3.3.+'
}
repositories { mavenCentral() }
bootRun { jvmArgs(["-Xms2g", "-Xmx2g", "-XX:+ExitOnOutOfMemoryError", "-Djdk.tracePinnedThreads=full"]) }
def javaBytecodeVersion = project.property('java.bytecode.version')
println "Java bytecode version: " + javaBytecodeVersion
tasks.withType(JavaCompile) {
sourceCompatibility = javaBytecodeVersion
targetCompatibility = javaBytecodeVersion
}
tasks.withType(KotlinCompile).all {
kotlinOptions {
jvmTarget = javaBytecodeVersion
}
}
dependencyManagement {
imports {
mavenBom "org.testcontainers:testcontainers-bom:1.20.+"
}
}
ext['httpclient5.version'] = '5.4'
ext['httpcore5.version'] = '5.3'
dependencies {
implementation "com.github.ben-manes.caffeine:caffeine"
implementation "com.google.guava:guava:33.3.+"
implementation "io.github.oshai:kotlin-logging-jvm:7.0.+"
implementation 'org.apache.httpcomponents.client5:httpclient5'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:2.0.+'
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-cache"
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
implementation "org.springframework.boot:spring-boot-starter-webflux"
runtimeOnly "com.h2database:h2"
runtimeOnly "org.postgresql:postgresql:42.+"
testImplementation "io.github.hakky54:logcaptor:2.9.+"
testImplementation "org.apache.commons:commons-compress:1.27.+"
testImplementation "org.assertj:assertj-core"
testImplementation "org.junit.jupiter:junit-jupiter"
testImplementation "org.junit-pioneer:junit-pioneer:2.3.+"
testImplementation 'org.mockito.kotlin:mockito-kotlin:5.4.+'
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation "org.springframework.boot:spring-boot-testcontainers"
testImplementation "org.testcontainers:junit-jupiter"
testImplementation "org.testcontainers:postgresql"
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
}
def activeProfiles = System.getenv('SPRING_PROFILES_ACTIVE')
if (activeProfiles?.contains('platform-tomcat') || activeProfiles?.contains('loom-tomcat')) {
dependencies {
// Takes precedence over spring-boot-starter-webflux if both on classpath
implementation 'org.springframework.boot:spring-boot-starter-web'
}
println 'Added spring-boot-starter-web dependency'
}
test {
useJUnitPlatform()
maxParallelForks = 2
jvmArgs '-XX:+EnableDynamicAgentLoading'
jvmArgs '-Xshare:off'
}
tasks.withType(Test).configureEach {
ext.failedTests = []
afterTest { descriptor, result ->
if (result.resultType == TestResult.ResultType.FAILURE) {
failedTests << ["${descriptor.className}::${descriptor.name}"]
}
}
afterSuite { suite, result ->
if (!suite.parent) {
if (!failedTests.empty) {
logger.lifecycle("Failed tests:")
failedTests.each { failedTest -> logger.lifecycle("${failedTest}") }
}
}
}
}
jacocoTestReport {
reports {
xml.required = true
}
}