Add support for running FindBugs

This commit is contained in:
Branden Archer
2017-09-13 10:47:01 -04:00
parent 4d3360b04e
commit c88fc677ac
3 changed files with 36 additions and 1 deletions

View File

@@ -1,4 +1,10 @@
apply plugin: 'com.android.application'
apply plugin: 'findbugs'
findbugs {
sourceSets = []
ignoreFailures = false
}
android {
compileSdkVersion 25
@@ -17,3 +23,22 @@ android {
}
}
}
task findbugs(type: FindBugs, dependsOn: 'assembleDebug') {
description 'Run findbugs'
group 'verification'
classes = fileTree('build/intermediates/classes/debug/')
source = fileTree('src/main/java')
classpath = files()
effort = 'max'
excludeFilter = file("./config/findbugs/exclude.xml")
reports {
xml.enabled = false
html.enabled = true
}
}

View File

@@ -0,0 +1,10 @@
<FindBugsFilter>
<Match>
<Class name="~.*R\$.*"/>
</Match>
<Match>
<Class name="~.*Manifest\$.*"/>
</Match>
</FindBugsFilter>