-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
85 lines (74 loc) · 2.84 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
85 lines (74 loc) · 2.84 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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import java.io.ByteArrayOutputStream
plugins {
kotlin("jvm") version "2.3.21"
kotlin("plugin.spring") version "2.3.21"
id("org.springframework.boot") version "3.5.13"
id("io.spring.dependency-management") version "1.1.7"
id("org.jlleitschuh.gradle.ktlint") version "14.2.0"
id("org.springdoc.openapi-gradle-plugin") version "1.9.0"
}
group = "org.genspectrum"
version = "0.0.1"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("io.github.microutils:kotlin-logging-jvm:3.0.5")
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.6")
implementation("org.flywaydb:flyway-database-postgresql:12.6.0")
implementation("org.postgresql:postgresql:42.7.11")
implementation("org.jetbrains.exposed:exposed-spring-boot-starter:1.2.0")
implementation("org.jetbrains.exposed:exposed-json:1.2.0")
implementation("org.jetbrains.exposed:exposed-jdbc:1.2.0")
implementation("org.jetbrains.exposed:exposed-kotlin-datetime:1.2.0")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.7.1-0.6.x-compat")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude(group = "org.mockito")
}
testImplementation("com.ninja-squad:springmockk:4.0.2")
testImplementation("org.testcontainers:testcontainers:2.0.5")
testImplementation("org.testcontainers:testcontainers-postgresql:2.0.5")
testImplementation("org.mock-server:mockserver-netty:5.15.0")
testImplementation("org.mock-server:mockserver-spring-test-listener:5.15.0")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
// taken from https://github.com/JLLeitschuh/ktlint-gradle/issues/809#issuecomment-2515514826
ktlint {
version.set("1.4.1")
}
kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict")
}
}
val checkDockerAvailable by tasks.registering(Exec::class) {
commandLine("docker", "info")
standardOutput = ByteArrayOutputStream()
errorOutput = ByteArrayOutputStream()
isIgnoreExitValue = true
doLast {
if (executionResult.get().exitValue != 0) {
throw GradleException("Docker is not available. Please start Docker before running tests.")
}
}
}
tasks.withType<Test> {
dependsOn(checkDockerAvailable)
useJUnitPlatform()
testLogging {
events("FAILED")
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showStandardStreams = true
}
}