-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
53 lines (46 loc) · 1.8 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
import io.gitlab.arturbosch.detekt.Detekt
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
plugins {
id(Plugins.ANDROID_APP) version PluginVersions.ANDROID_APP apply false
id(Plugins.LIBRARY) version PluginVersions.LIBRARY apply false
id(Plugins.KOTLIN) version PluginVersions.KOTLIN apply false
id(Plugins.DETEKT) version PluginVersions.DETEKT apply true
id(Plugins.BEN_MANES_VERSION) version PluginVersions.BEN_MANES_VERSION apply false
id(Plugins.HILT) version PluginVersions.HILT apply false
}
allprojects {
apply(plugin = Plugins.BEN_MANES_VERSION)
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
val version = candidate.version
val stableKeyword =
listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
isStable.not()
}
}
}
subprojects {
apply(plugin = Plugins.DETEKT)
detekt {
toolVersion = PluginVersions.DETEKT
config = files("${project.rootDir}/config/detekt/detekt.yml")
autoCorrect = true
}
tasks.withType<Detekt>().configureEach {
reports {
xml.required.set(true)
xml.outputLocation.set(file("${project.rootDir}/build/reports/detekt.xml"))
html.required.set(true)
html.outputLocation.set(file("${project.rootDir}/build/reports/detekt.html"))
txt.required.set(true)
txt.outputLocation.set(file("${project.rootDir}/build/reports/detekt.txt"))
sarif.required.set(false)
}
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}