added detekt config, works only with repo and dependency specified

This commit is contained in:
alex 2020-02-17 20:21:59 +03:00
parent a919e84c6d
commit 6d81c5630d
1 changed files with 31 additions and 1 deletions

View File

@ -1,3 +1,12 @@
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2" }
}
dependencies {
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.5.1"
}
}
def getServerProjectSources
def getAndroidProjectSources
@ -62,7 +71,7 @@ gradle.projectsEvaluated {
}
}
subprojects {
subprojects { subproject ->
pluginManager.withPlugin('com.android.application') {
android.applicationVariants.all { variant ->
task("staticAnalysis${variant.name.capitalize()}") {
@ -71,6 +80,27 @@ gradle.projectsEvaluated {
}
}
}
tasks.withType(io.gitlab.arturbosch.detekt.Detekt) {
exclude '**/test/'
exclude 'resources/'
exclude 'build/'
exclude 'tmp/'
jvmTarget = "1.8"
}
detekt {
config = files("$buildScriptsDir/kotlin/detekt-config.yml")
reports {
txt.enabled = false
html.enabled = false
xml {
enabled = true
destination = file("${rootProject.buildDir}/reports/kotlin-detekt-${subproject.name}.xml")
}
}
}
}
}