-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
49 lines (40 loc) · 1.33 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
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektCreateBaselineTask
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id(Plugins.androidApplication) version PluginVersions.agp apply false
id(Plugins.androidLibrary) version PluginVersions.agp apply false
id(Plugins.kotlinAndroid) version PluginVersions.kotlin apply false
id(Plugins.detekt) version PluginVersions.detekt apply true
id(Plugins.dagger) version PluginVersions.dagger apply false
id(Plugins.kotlinJvm) version PluginVersions.kotlin apply false
}
tasks.register<Delete>(Tasks.CLEANUP).configure {
delete(rootProject.buildDir)
}
detekt {
toolVersion = PluginVersions.detekt
config = files("$rootDir/${Config.detekt.configFilePath}")
}
tasks.withType<Detekt> {
include("**/*.kt")
include("**/*.kts")
exclude(".*/resources/.*")
exclude(".*/build/.*")
exclude("/versions.gradle.kts")
exclude("buildSrc/settings.gradle.kts")
}
tasks.withType<Detekt>().configureEach {
jvmTarget = Config.jvmTarget
}
tasks.withType<DetektCreateBaselineTask>().configureEach {
jvmTarget = Config.jvmTarget
}
allprojects {
apply(plugin = Plugins.detekt)
detekt {
config = files("$rootDir/${Config.detekt.configFilePath}")
allRules = true
buildUponDefaultConfig = true
}
}