-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
154 lines (129 loc) · 5.76 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
154 lines (129 loc) · 5.76 KB
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
plugins {
id("java")
id("io.freefair.lombok") version "9.5.0"
id("com.diffplug.spotless") version "8.7.0"
id("io.quarkus") version "3.37.0"
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
lombok {
version = "1.18.42"
}
tasks.withType<JavaCompile>().configureEach {
// Retain method parameter names in compiled bytecode, which then
// become available via reflection.
options.compilerArgs.add("-parameters")
}
repositories {
mavenCentral()
maven {
url = uri("https://maven.pkg.github.com/triplea-game/triplea")
credentials {
username = System.getenv("GITHUB_ACTOR") ?: project.findProperty("triplea_github_username") as String?
password = System.getenv("GH_TOKEN") ?: project.findProperty("triplea_github_access_token") as String?
}
}
}
/* "testInteg" runs tests that require a database or a server to be running */
val testInteg: SourceSet = sourceSets.create("testInteg") {
java {
java.srcDir("src/testInteg/java")
compileClasspath += sourceSets.main.get().output
runtimeClasspath += output + compileClasspath
}
}
configurations[testInteg.implementationConfigurationName].extendsFrom(configurations.testImplementation.get())
configurations[testInteg.runtimeOnlyConfigurationName].extendsFrom(configurations.testRuntimeOnly.get())
val testIntegTask = tasks.register<Test>("testInteg") {
group = "verification"
testClassesDirs = sourceSets["testInteg"].output.classesDirs
classpath = sourceSets["testInteg"].runtimeClasspath
// Required for Quarkus @QuarkusTest to use the JBoss log manager
systemProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager")
}
tasks.check {
dependsOn(testIntegTask)
}
tasks.clean {
// Clean Quarkus build artifacts
delete("build/quarkus-app")
}
tasks {
withType<Test> {
useJUnitPlatform()
testLogging {
events("skipped", "failed")
}
jvmArgs("-XX:+EnableDynamicAgentLoading")
val outputByTest = mutableMapOf<String, StringBuilder>()
addTestOutputListener { descriptor, event ->
val key = "${descriptor.className}.${descriptor.name}"
outputByTest.getOrPut(key) { StringBuilder() }.append(event.message)
}
addTestListener(object : TestListener {
override fun beforeSuite(suite: TestDescriptor) {}
override fun afterSuite(suite: TestDescriptor, result: TestResult) {}
override fun beforeTest(testDescriptor: TestDescriptor) {}
override fun afterTest(testDescriptor: TestDescriptor, result: TestResult) {
val key = "${testDescriptor.className}.${testDescriptor.name}"
val output = outputByTest.remove(key)
if (result.resultType == TestResult.ResultType.FAILURE && !output.isNullOrEmpty()) {
println("\n-- Output for ${testDescriptor.displayName} --\n$output")
}
}
})
}
}
spotless {
java {
googleJavaFormat()
removeUnusedImports()
}
}
val quarkusPlatformVersion = "3.37.0"
val gsonVersion = "2.14.0"
val junitVersion = "6.1.0"
val mockitoVersion = "5.23.0"
val tripleaVersion = "2.7.15496"
dependencies {
implementation(enforcedPlatform("io.quarkus.platform:quarkus-bom:$quarkusPlatformVersion"))
// Quarkus extensions
implementation("io.quarkus:quarkus-resteasy-jackson") // JAX-RS (Classic) + Jackson
implementation("io.quarkus:quarkus-resteasy-qute") // Qute templating (mustache-like)
implementation("io.quarkus:quarkus-agroal") // JDBC connection pool
implementation("io.quarkus:quarkus-jdbc-postgresql") // PostgreSQL + Dev Services
implementation("io.quarkus:quarkus-flyway") // DB migrations on startup
implementation("io.quarkus:quarkus-scheduler") // @Scheduled background tasks
implementation("org.flywaydb:flyway-database-postgresql")
// JDBI — framework-agnostic, wires against any DataSource
implementation("org.jdbi:jdbi3-core:3.53.0")
implementation("org.jdbi:jdbi3-sqlobject:3.53.0")
// Gson — used by GithubApiClient
implementation("com.google.code.gson:gson:$gsonVersion")
// SnakeYAML Engine — used by MapNameReader to parse map.yml files
implementation("org.snakeyaml:snakeyaml-engine:2.10")
// Annotations previously pulled in transitively by DropWizard
implementation("com.google.guava:guava:33.6.0-jre") // @VisibleForTesting
implementation("com.google.code.findbugs:jsr305:3.0.2") // @Nonnull
// TripleA shared libraries
implementation("triplea:lobby-client-data:${tripleaVersion}")
// Test dependencies
testImplementation(enforcedPlatform("io.quarkus.platform:quarkus-bom:$quarkusPlatformVersion"))
testImplementation("io.quarkus:quarkus-junit5") // @QuarkusTest + Dev Services
testImplementation("com.github.database-rider:rider-junit5:1.44.0")
testImplementation("com.github.npathai:hamcrest-optional:2.0.0")
testImplementation("org.awaitility:awaitility:4.3.0")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testImplementation("org.assertj:assertj-core:3.27.7")
testImplementation("org.mockito:mockito-core:$mockitoVersion")
testImplementation("org.mockito:mockito-junit-jupiter:$mockitoVersion")
testImplementation("org.wiremock:wiremock:3.13.1")
testImplementation("ru.lanwen.wiremock:wiremock-junit5:1.3.1")
testImplementation("uk.co.datumedge:hamcrest-json:0.3")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:6.1.0")
}