-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
70 lines (64 loc) · 1.97 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
import com.diffplug.gradle.spotless.SpotlessExtension
import kotlinx.kover.gradle.plugin.dsl.KoverProjectExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.powerassert.gradle.PowerAssertGradleExtension
plugins {
alias(libs.plugins.multiplatform) apply false
alias(libs.plugins.publish) apply false
alias(libs.plugins.assert)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
alias(libs.plugins.kover)
}
val assertId = libs.plugins.assert.get().pluginId
val spotlessId = libs.plugins.spotless.get().pluginId
val publishId = libs.plugins.publish.get().pluginId
dependencies {
kover(projects.parser)
kover(projects.typed)
kover(projects.generation)
}
subprojects {
apply(plugin = assertId)
@Suppress("OPT_IN_USAGE")
configure<PowerAssertGradleExtension> {
functions = listOf(
"kotlin.test.assertEquals",
"kotlin.test.assertTrue",
"kotlin.test.assertFalse"
)
}
apply(plugin = spotlessId)
configure<SpotlessExtension> {
kotlin {
target("**/*.kt", "**/*.kts")
ktfmt().kotlinlangStyle().configure {
it.setBlockIndent(2)
it.setContinuationIndent(2)
it.setRemoveUnusedImport(true)
}
}
}
apply(plugin = publishId)
configure<com.vanniktech.maven.publish.MavenPublishBaseExtension> {
val shouldSign =
project.gradle.startParameter.taskNames.none {
it.contains("publishToMavenLocal", ignoreCase = true)
}
if (shouldSign) signAllPublications()
}
tasks {
withType<JavaCompile> { options.release.set(11) }
withType<KotlinCompile> { compilerOptions { jvmTarget.set(JvmTarget.JVM_11) } }
withType<Test> {
useJUnitPlatform()
testLogging {
exceptionFormat = TestExceptionFormat.FULL
events("SKIPPED", "FAILED")
}
}
}
}
tasks.dokkaHtmlMultiModule { moduleName.set("OpenAPI-kt") }