./gradlew app:findbugs
Created
January 22, 2015 19:06
-
-
Save patrickhammond/aa3515e494164dbfdae6 to your computer and use it in GitHub Desktop.
FindBugs snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
apply plugin: 'findbugs' | |
... | |
task findbugs(type: FindBugs, dependsOn: assembleDebug) { | |
excludeFilter file("${project.rootDir}/config/findbugs/exclude.xml") | |
classes = fileTree('build/intermediates/classes/debug/') // Varies based on your app build configs and flavors... | |
source = fileTree('src/main/java/') | |
classpath = files() | |
effort = 'max' | |
reports { | |
xml.enabled = false | |
html.enabled = true | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<FindBugsFilter> | |
<!-- http://stackoverflow.com/questions/7568579/eclipsefindbugs-exclude-filter-files-doesnt-work --> | |
<Match> | |
<Class name="~.*\.R\$.*"/> | |
</Match> | |
<Match> | |
<Class name="~.*\.Manifest\$.*"/> | |
</Match> | |
<!-- All bugs in test classes, except for JUnit-specific bugs --> | |
<Match> | |
<Class name="~.*\.*Test" /> | |
<Not> | |
<Bug code="IJU" /> | |
</Not> | |
</Match> | |
</FindBugsFilter> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment