55 lines
2.1 KiB
Groovy
55 lines
2.1 KiB
Groovy
apply plugin: 'io.gitlab.arturbosch.detekt'
|
||
|
||
def configPath = rootProject.file("codequality").path
|
||
|
||
detekt {
|
||
toolVersion = "1.15.0"
|
||
input = files(
|
||
"src/main/java",
|
||
"src/jinlvvan/java",
|
||
"src/driverm1/java"
|
||
)
|
||
parallel = false
|
||
//将配置文件应用于detekt的默认配置文件之上
|
||
buildUponDefaultConfig = false
|
||
//规则集
|
||
config.setFrom("${configPath}/detekt.yml")
|
||
//指定基准文件。在detekt的后续运行中,所有发现都存储在此文件中
|
||
// baseline = file("${configPath}/baseline.xml")
|
||
disableDefaultRuleSets = false
|
||
ignoreFailures = true
|
||
// Android: Don't create tasks for the specified build types (e.g. "release")
|
||
// ignoredBuildTypes = ["release"]
|
||
// Android: Don't create tasks for the specified build flavor (e.g. "production")
|
||
// ignoredFlavors = ["production"]
|
||
// Android: Don't create tasks for the specified build variants (e.g. "productionRelease")
|
||
// ignoredVariants = ["productionRelease"]
|
||
}
|
||
|
||
tasks.detekt.jvmTarget = "1.8"
|
||
|
||
tasks.named("detekt").configure {
|
||
reports {
|
||
// Enable/Disable HTML report (default: true)
|
||
html {
|
||
enabled = true
|
||
// Path where HTML report will be stored (default: `build/reports/detekt/detekt.html`)
|
||
destination = new File(new File("${project.rootProject.buildDir.path}/reports/detekt"), "${project.name}-detekt.html")
|
||
}
|
||
xml {
|
||
enabled = true
|
||
destination = new File(new File("${project.rootProject.buildDir.path}/reports/detekt"), "${project.name}-detekt.xml")
|
||
}
|
||
txt {
|
||
enabled = false
|
||
// destination = new File(new File("${project.rootProject.buildDir.path}/reports/detekt"), "${project.name}-detekt.txt")
|
||
}
|
||
sarif {
|
||
// Enable/Disable SARIF report (default: false)
|
||
enabled = true
|
||
// Path where SARIF report will be stored (default: `build/reports/detekt/detekt.sarif`)
|
||
destination = new File(new File("${project.rootProject.buildDir.path}/reports/detekt"), "${project.name}-detekt.sarif")
|
||
}
|
||
}
|
||
}
|