/
build.gradle.kts
92 lines (75 loc) 路 2.78 KB
/
build.gradle.kts
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
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.ktlint)
id("maven-publish")
}
repositories {
mavenCentral()
}
subprojects {
if (name.endsWith("bom")) {
return@subprojects
}
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jlleitschuh.gradle.ktlint")
java {
withJavadocJar()
withSourcesJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
kotlin {
jvmToolchain {
this.languageVersion.set(JavaLanguageVersion.of("21"))
}
}
sourceSets.create("integrationTest") {
compileClasspath += sourceSets["main"].output + sourceSets["test"].output
runtimeClasspath += sourceSets["main"].output + sourceSets["test"].output
java.srcDir("src/integrationTest/kotlin")
resources.srcDir("src/integrationTest/resources")
}
val integrationTestImplementation by configurations.getting {
extendsFrom(configurations.implementation.get())
}
configurations["integrationTestRuntimeOnly"].extendsFrom(configurations.runtimeOnly.get())
task<Test>("integrationTest") {
useJUnitPlatform()
description = "Runs integration tests."
group = "verification"
testClassesDirs = sourceSets["integrationTest"].output.classesDirs
classpath = sourceSets["integrationTest"].runtimeClasspath
shouldRunAfter("test")
}
dependencies {
implementation(platform(kotlin("bom")))
implementation(kotlin("stdlib-jdk8"))
implementation(rootProject.libs.slf4j.api)
implementation(rootProject.libs.kotlinx.io)
testImplementation(kotlin("test-junit5"))
testImplementation(rootProject.libs.junit.jupiter)
integrationTestImplementation(kotlin("test-junit5"))
integrationTestImplementation(rootProject.libs.kotlinx.coroutines)
integrationTestImplementation(rootProject.libs.junit.jupiter)
integrationTestImplementation(platform(rootProject.libs.okhttp.bom))
integrationTestImplementation("com.squareup.okhttp3:okhttp")
}
tasks.test {
useJUnitPlatform()
testLogging {
events = TestLogEvent.values().toSet() - TestLogEvent.STARTED
exceptionFormat = TestExceptionFormat.FULL
}
exclude("dev.pellet.integration")
}
tasks.named<Test>("integrationTest") {
systemProperty("benchmark.requests.total", System.getProperty("benchmark.requests.total"))
testLogging {
events = TestLogEvent.values().toSet() - TestLogEvent.STARTED
exceptionFormat = TestExceptionFormat.FULL
}
}
}