-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
51 lines (46 loc) · 1.65 KB
/
build.gradle
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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'com.google.dagger.hilt.android' version '2.44' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
id "io.gitlab.arturbosch.detekt" version "1.22.0"
}
def projectSource = file(projectDir)
def configFile = files("$projectDir/config/detekt.yml")
def baselineFile = file("$projectDir/config/baseline.xml")
def kotlinFiles = "**/*.kt"
def resourceFiles = "**/resources/**"
def buildFiles = "**/build/**"
apply plugin: 'io.gitlab.arturbosch.detekt'
tasks.register("detektAll", io.gitlab.arturbosch.detekt.Detekt) {
def autoFix = project.hasProperty('detektAutoFix')
description = "Detekt All modules"
parallel = true
ignoreFailures = true
autoCorrect = autoFix
buildUponDefaultConfig = true
setSource(projectSource)
baseline.set(baselineFile)
config.setFrom(configFile)
include(kotlinFiles)
exclude(resourceFiles, buildFiles)
reports {
html.enabled = true
xml.enabled = true
}
}
tasks.register("detektGenerateBaseline", io.gitlab.arturbosch.detekt.DetektCreateBaselineTask) {
description = "Detekt to generate baseline"
parallel = true
ignoreFailures = false
buildUponDefaultConfig = true
setSource(projectSource)
baseline.set(baselineFile)
config.setFrom(configFile)
include(kotlinFiles)
exclude(resourceFiles, buildFiles)
}
dependencies {
detektPlugins "io.gitlab.arturbosch.detekt:detekt-formatting:1.16.0"
}