-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
82 lines (71 loc) · 2.3 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
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jlleitschuh.gradle.ktlint.KtlintExtension
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
plugins {
id(Plugins.KotlinPlugin) version PluginVersions.KotlinPluginVersion
id(Plugins.SshPlugin) version PluginVersions.SshVersion
id(Plugins.JacocoPlugin)
id(Plugins.DetektPlugin) version PluginVersions.DetektVersion
id(Plugins.KLintPlugin) version PluginVersions.KtLintVersion
application
}
apply(from = "deploy.gradle")
allprojects {
repositories {
mavenCentral()
}
apply(plugin = Plugins.KotlinPlugin)
apply(plugin = Plugins.DetektPlugin)
apply(plugin = Plugins.KLintPlugin)
apply(from = "$rootDir/gradle/jacoco.gradle.kts")
tasks {
withType<KotlinCompile>().all {
kotlinOptions {
jvmTarget = "17"
freeCompilerArgs =
freeCompilerArgs +
arrayOf(
// "-Xdebug", // uncoment to avoid variables to be optimized out
"-Xjvm-default=all",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi",
)
}
}
withType<Test>().all {
jvmArgs =
listOf(
"--add-opens",
"java.base/java.time=ALL-UNNAMED",
"--add-opens",
"java.base/java.lang.reflect=ALL-UNNAMED",
)
}
withType<JavaCompile>().all {
sourceCompatibility = "17"
targetCompatibility = "17"
}
detekt {
allRules = true
autoCorrect = true
buildUponDefaultConfig = true
config.setFrom("$rootDir/detekt-config.yml")
source.setFrom("src/main/kotlin")
}
withType<Detekt>().configureEach {
reports {
html.required.set(true)
}
}
configure<KtlintExtension> {
ignoreFailures = false
reporters {
reporter(ReporterType.HTML)
}
}
check {
dependsOn(ktlintFormat)
}
}
}