2017-07-29 22:31:20 +02:00
|
|
|
// Applies code quality plugins when -Pqc is passed to the gradle
|
|
|
|
def isCodeQualityEnabled = project.hasProperty('qc')
|
|
|
|
|
2017-07-30 17:05:57 +02:00
|
|
|
// KtLint
|
2017-07-29 22:31:20 +02:00
|
|
|
if (isCodeQualityEnabled) {
|
|
|
|
apply plugin: "org.jlleitschuh.gradle.ktlint"
|
|
|
|
|
|
|
|
ktlint {
|
|
|
|
version = versions.ktlint
|
2018-02-25 22:19:56 +01:00
|
|
|
outputToConsole = true
|
2017-11-16 22:04:38 +01:00
|
|
|
android = true
|
2017-07-29 22:31:20 +02:00
|
|
|
}
|
2017-07-30 17:05:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Detekt
|
|
|
|
if (isCodeQualityEnabled) {
|
|
|
|
if (!project.rootProject.plugins.hasPlugin("io.gitlab.arturbosch.detekt")) {
|
|
|
|
Project rootProject = project.rootProject
|
|
|
|
rootProject.apply {
|
|
|
|
apply plugin: "io.gitlab.arturbosch.detekt"
|
|
|
|
|
|
|
|
detekt {
|
2021-04-22 20:51:12 +02:00
|
|
|
buildUponDefaultConfig = true
|
|
|
|
toolVersion = versions.detekt
|
2021-05-19 18:08:16 +02:00
|
|
|
// Builds the AST in parallel. Rules are always executed in parallel.
|
|
|
|
// Can lead to speedups in larger projects.
|
|
|
|
parallel = true
|
2021-04-22 20:51:12 +02:00
|
|
|
baseline = file("${rootProject.projectDir}/detekt-baseline.xml")
|
|
|
|
config = files("${rootProject.projectDir}/detekt-config.yml")
|
2017-07-30 17:05:57 +02:00
|
|
|
}
|
|
|
|
}
|
2021-04-22 20:51:12 +02:00
|
|
|
tasks.detekt.jvmTarget = "1.8"
|
2017-07-30 17:05:57 +02:00
|
|
|
}
|
2021-04-22 20:51:12 +02:00
|
|
|
|
2017-08-09 21:56:20 +02:00
|
|
|
}
|