-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
66 lines (55 loc) · 1.87 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
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.7.21"
jacoco
application
id("io.gitlab.arturbosch.detekt").version("1.21.0")
}
group = "dev.gmarmstrong"
version = "0.1.1"
repositories {
mavenCentral()
}
detekt {
buildUponDefaultConfig = true // preconfigure defaults
allRules = false // whether to activate all available (even unstable) rules.
config = files("$projectDir/config/detekt/detekt.yml") // point to custom config
baseline = file("$projectDir/config/detekt/baseline.xml") // suppress issues before introducing detekt
}
dependencies {
testImplementation(kotlin("test"))
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.21.0")
}
tasks.test {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
}
application {
mainClass.set("letterboxed.MainKt")
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
// Kotlin DSL
tasks.withType<Detekt>().configureEach {
jvmTarget = "1.8"
}
tasks.withType<DetektCreateBaselineTask>().configureEach {
jvmTarget = "1.8"
}
tasks.jacocoTestReport {
dependsOn(tasks.test) // tests are required to run before generating the report
reports {
xml.required.set(true)
}
}
tasks.withType<Detekt>().configureEach {
reports {
html.required.set(true) // observe findings in your browser with structure and code snippets
xml.required.set(true) // checkstyle like format mainly for integrations like Jenkins
txt.required.set(true) // similar to console output, contains issue signature to manually edit baseline files
sarif.required.set(true) // standardized SARIF format to support integrations with GitHub Code Scanning
}
}