-
Notifications
You must be signed in to change notification settings - Fork 22
/
detekt.gradle
52 lines (46 loc) · 1.87 KB
/
detekt.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
52
repositories {
mavenCentral()
maven { url "https://dl.bintray.com/arturbosch/code-analysis" }
configurations {
detekt
}
def reportFile = "$project.projectDir.absolutePath/reports/detekt.txt"
task detekt(type: JavaExec) {
group = "verification"
main = "io.gitlab.arturbosch.detekt.cli.Main"
classpath = configurations.detekt
def input = "$project.projectDir.absolutePath"
def config = "$project.projectDir/detekt.yml"
def reports = "txt:$reportFile"
def baseline = "$project.projectDir.absolutePath/reports/baseline.xml"
def filters = ".*test.*"
def params = ["-i", input, "-c", config, "-f", filters, "-r", reports, "-b", baseline]
subprojects.each{subproject ->
inputs.files fileTree(subproject.projectDir).include("**/src/main/kotlin/**/*.kt")
}
inputs.file config
outputs.file reportFile
args(params)
}
task detektEstablishAcceptedErrors(type: JavaExec) {
group = "verification"
main = "io.gitlab.arturbosch.detekt.cli.Main"
classpath = configurations.detekt
def input = "$project.projectDir.absolutePath"
def config = "$project.projectDir/detekt.yml"
def reports = "txt:$reportFile"
def baseline = "$project.projectDir.absolutePath/reports/baseline.xml"
def filters = ".*test.*"
def params = ["-i", input, "-c", config, "-f", filters, "-r", reports, "-b", baseline, "-cb"]
subprojects.each{subproject ->
inputs.files fileTree(subproject.projectDir).include("**/src/main/kotlin/**/*.kt")
}
inputs.file config
outputs.file reportFile
args(params)
}
dependencies {
detekt "io.gitlab.arturbosch.detekt:detekt-cli:1.0.0.RC9"
detekt "io.gitlab.arturbosch.detekt:detekt-formatting:1.0.0.RC9"
}
}