Detekt tasks config for each subproject

This commit is contained in:
alex 2020-02-18 14:37:45 +03:00
parent 6d81c5630d
commit ede5d3c902
2 changed files with 11 additions and 7 deletions

View File

@ -207,7 +207,7 @@ getLintTask = { buildVariant ->
return lintTaskPath
}
getKotlinDetektTasks = { subprojects.collect { it.tasks.findByName("detekt").path }.findAll { !it.contains(":libs") } }
getKotlinDetektTasks = { subprojects.findResults { it.tasks.findByName("detekt")?.path }.findAll { !it.contains(":libs") } }
task optimizePng {
doFirst {

View File

@ -81,12 +81,16 @@ gradle.projectsEvaluated {
}
}
tasks.withType(io.gitlab.arturbosch.detekt.Detekt) {
exclude '**/test/'
exclude 'resources/'
exclude 'build/'
exclude 'tmp/'
jvmTarget = "1.8"
def regex = ~':detekt$'
tasks.forEach { task ->
if (!task.name.contains(":libs") && task.path =~ regex) {
task.exclude '**/test/**'
task.exclude 'resources/'
task.exclude 'build/'
task.exclude 'tmp/'
task.jvmTarget = "1.8"
}
}
detekt {