added detekt config, works only with repo and dependency specified
This commit is contained in:
parent
a919e84c6d
commit
6d81c5630d
|
|
@ -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 getServerProjectSources
|
||||||
def getAndroidProjectSources
|
def getAndroidProjectSources
|
||||||
|
|
||||||
|
|
@ -62,7 +71,7 @@ gradle.projectsEvaluated {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
subprojects {
|
subprojects { subproject ->
|
||||||
pluginManager.withPlugin('com.android.application') {
|
pluginManager.withPlugin('com.android.application') {
|
||||||
android.applicationVariants.all { variant ->
|
android.applicationVariants.all { variant ->
|
||||||
task("staticAnalysis${variant.name.capitalize()}") {
|
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")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue