2014-12-20 00:49:09 +00:00
|
|
|
apply plugin: 'findbugs'
|
|
|
|
|
2015-05-20 18:55:24 +00:00
|
|
|
afterEvaluate {
|
|
|
|
def variants = plugins.hasPlugin('com.android.application') ?
|
|
|
|
android.applicationVariants : android.libraryVariants
|
|
|
|
|
|
|
|
variants.each { variant ->
|
|
|
|
def task = project.task("findBugs${variant.name.capitalize()}", type: FindBugs) {
|
|
|
|
group = 'verification'
|
|
|
|
description = "Run FindBugs for the ${variant.description}."
|
|
|
|
|
|
|
|
effort = 'max'
|
|
|
|
ignoreFailures = true
|
|
|
|
|
|
|
|
includeFilter = file("$rootProject.projectDir/config/findbugs/include_filter.xml")
|
|
|
|
excludeFilter = file("$rootProject.projectDir/config/findbugs/exclude_filter.xml")
|
|
|
|
|
|
|
|
def variantCompile = variant.javaCompile
|
|
|
|
|
|
|
|
classes = fileTree(variantCompile.destinationDir)
|
|
|
|
source = variantCompile.source
|
|
|
|
classpath = variantCompile.classpath.plus(project.files(android.bootClasspath))
|
|
|
|
|
|
|
|
dependsOn(variantCompile)
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.getByName('check').dependsOn(task)
|
|
|
|
}
|
2014-12-20 00:49:09 +00:00
|
|
|
}
|