mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-12 15:37:17 +03:00
33 lines
956 B
Groovy
33 lines
956 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 = libs.versions.ktlint.get()
|
|
outputToConsole = true
|
|
android = true
|
|
}
|
|
}
|
|
|
|
// 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 {
|
|
buildUponDefaultConfig = true
|
|
toolVersion = libs.versions.detekt.get()
|
|
// Builds the AST in parallel. Rules are always executed in parallel.
|
|
// Can lead to speedups in larger projects.
|
|
parallel = true
|
|
}
|
|
}
|
|
tasks.detekt.jvmTarget = "17"
|
|
}
|
|
}
|