Add support for running FindBugs
This commit is contained in:
@@ -9,7 +9,7 @@ install:
|
||||
- echo y | android update sdk -u -a -t extra-google-m2repository
|
||||
- echo y | android update sdk -u -a -t extra-android-m2repository
|
||||
|
||||
script: ./gradlew assembleRelease testReleaseUnitTest lintRelease
|
||||
script: ./gradlew assembleRelease testReleaseUnitTest lintRelease findbugs
|
||||
|
||||
after_failure:
|
||||
- cat app/build/reports/findbugs/findbugs.html
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
10
app/config/findbugs/exclude.xml
Normal file
10
app/config/findbugs/exclude.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<FindBugsFilter>
|
||||
|
||||
<Match>
|
||||
<Class name="~.*R\$.*"/>
|
||||
</Match>
|
||||
<Match>
|
||||
<Class name="~.*Manifest\$.*"/>
|
||||
</Match>
|
||||
|
||||
</FindBugsFilter>
|
||||
Reference in New Issue
Block a user