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
|
|
|
|
}
|
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 {
|
|
|
|
version = versions.detekt
|
|
|
|
profile("main") {
|
|
|
|
config = "${rootProject.projectDir}/detekt-config.yml"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-08-09 21:56:20 +02:00
|
|
|
}
|