-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle.kts
162 lines (149 loc) · 4.11 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
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
155
156
157
158
159
160
161
import org.gradle.kotlin.dsl.libs
import org.gradle.plugins.ide.idea.model.IdeaModel
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
kotlin("jvm").version(libs.versions.kotlin)
alias(libs.plugins.dokka)
alias(libs.plugins.spotless)
alias(libs.plugins.testLogger)
alias(libs.plugins.kover)
alias(libs.plugins.detekt)
alias(libs.plugins.binaryCompatibilityValidator)
id("stove-publishing") apply false
idea
java
}
group = "com.trendyol"
version = CI.version(project)
allprojects {
extra.set("dokka.outputDirectory", rootDir.resolve("docs"))
}
kover {
reports {
filters {
excludes {
classes(
"com.trendyol.stove.functional.*",
"com.trendyol.stove.testing.e2e.system.abstractions.*",
"com.trendyol.stove.testing.e2e.system.annotations.*",
"com.trendyol.stove.testing.e2e.serialization.*",
"com.trendyol.stove.testing.e2e.standalone.*",
"com.trendyol.stove.testing.e2e.streams.*",
"stove.spring.example.*",
"stove.spring.standalone.example.*",
"stove.spring.streams.example.*",
"stove.ktor.example.*"
)
}
}
}
}
val related = subprojects.of("lib", "spring", "examples", "ktor")
dependencies {
related.forEach {
kover(it)
}
}
subprojects.of("lib", "spring", "examples", "ktor") {
apply {
plugin("kotlin")
plugin(rootProject.libs.plugins.spotless.get().pluginId)
plugin(rootProject.libs.plugins.dokka.get().pluginId)
plugin(rootProject.libs.plugins.testLogger.get().pluginId)
plugin(rootProject.libs.plugins.kover.get().pluginId)
plugin(rootProject.libs.plugins.detekt.get().pluginId)
plugin("idea")
}
val testImplementation by configurations
val libs = rootProject.libs
dependencies {
api(libs.arrow.core)
}
detekt {
buildUponDefaultConfig = true
parallel = true
config.from(rootProject.file("detekt.yml"))
}
dependencies {
testImplementation(kotlin("test"))
testImplementation(libs.kotest.runner.junit5)
testImplementation(libs.kotest.framework.api)
testImplementation(libs.kotest.property)
testImplementation(libs.kotest.arrow)
detektPlugins(libs.detekt.formatting)
}
spotless {
kotlin {
ktlint(libs.versions.ktlint.get()).setEditorConfigPath(rootProject.layout.projectDirectory.file(".editorconfig"))
targetExclude("build/", "generated/", "out/")
targetExcludeIfContentContains("generated")
targetExcludeIfContentContainsRegex("generated.*")
}
}
the<IdeaModel>().apply {
module {
isDownloadSources = true
isDownloadJavadoc = true
}
}
tasks {
compileKotlin {
incremental = true
}
test {
useJUnitPlatform()
testlogger {
setTheme("mocha")
showStandardStreams = !runningOnCI
showExceptions = true
showCauses = true
}
reports {
junitXml.required.set(true)
}
jvmArgs("--add-opens", "java.base/java.util=ALL-UNNAMED")
}
kotlin {
jvmToolchain(17)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
allWarningsAsErrors = true
freeCompilerArgs.addAll(
"-Xjsr305=strict",
"-Xcontext-receivers",
"-Xsuppress-version-warnings"
)
}
}
}
}
val publishedProjects = listOf(
"stove-testing-e2e",
"stove-testing-e2e-couchbase",
"stove-testing-e2e-elasticsearch",
"stove-testing-e2e-http",
"stove-testing-e2e-kafka",
"stove-testing-e2e-mongodb",
"stove-testing-e2e-rdbms",
"stove-testing-e2e-rdbms-postgres",
"stove-testing-e2e-rdbms-mssql",
"stove-testing-e2e-wiremock",
"stove-testing-e2e-redis",
"stove-ktor-testing-e2e",
"stove-spring-testing-e2e",
"stove-spring-testing-e2e-kafka"
)
subprojects.of("lib", "spring", "ktor", filter = { p -> publishedProjects.contains(p.name) }) {
apply {
plugin("java")
plugin("stove-publishing")
}
java {
withSourcesJar()
withJavadocJar()
}
}
tasks.withType<DokkaMultiModuleTask>().configureEach {
outputDirectory.set(file(rootDir.resolve("docs/source")))
}