1
0
mirror of https://github.com/ultrasonic/ultrasonic synced 2024-12-13 17:27:02 +01:00
ultrasonic-app-subsonic-and.../gradle_scripts/code_quality.gradle
Yahor Berdnikau 76c61409a4 Added code coverage.
Only show kotlin code coverage.
2017-08-09 21:56:20 +02:00

29 lines
741 B
Groovy

// Applies code quality plugins when -Pqc is passed to the gradle
def isCodeQualityEnabled = project.hasProperty('qc')
// KtLint
if (isCodeQualityEnabled) {
apply plugin: "org.jlleitschuh.gradle.ktlint"
ktlint {
version = versions.ktlint
}
}
// 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"
}
}
}
}
}