Skip to content

Commit

Permalink
build: setup findbugs gradle plugin
Browse files Browse the repository at this point in the history
sets up gradle plugin to run on CI and generate a HTML report (avoid failing the build for now)
  • Loading branch information
fractalwrench committed May 1, 2018
1 parent 31cb452 commit 255e025
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ before_script:
- while [[ `adb shell pm path android` == 'Error'* ]]; do sleep 2; done
- adb shell input keyevent 82 &

script: ./gradlew lint checkstyle createDebugCoverageReport coveralls
script: ./gradlew lint checkstyle findbugs createDebugCoverageReport coveralls

sudo: false

Expand Down
9 changes: 9 additions & 0 deletions config/findbugs/filter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<Match>
<Class name="~.*\.R\$.*"/>
</Match>
<Match>
<Class name="~.*\.Manifest\$.*"/>
</Match>
</FindBugsFilter>
25 changes: 25 additions & 0 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apply plugin: 'com.getkeepsafe.dexcount'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'findbugs'

repositories {
jcenter()
Expand Down Expand Up @@ -160,3 +161,27 @@ dexcount {
orderByMethodCount = true
verbose true
}

findbugs {
sourceSets = []
ignoreFailures = true // don't break the build for now
}

task findbugs(type: FindBugs, dependsOn: assemble) {

effort "max"
reportLevel "low"
pluginClasspath = project.configurations.findbugsPlugins
classes = fileTree('build/intermediates/classes/')
source = fileTree('src/')
classpath = files()

excludeFilter = file("../config/findbugs/filter.xml")

reports {
reports {
xml.enabled = false
html.enabled = true
}
}
}

0 comments on commit 255e025

Please sign in to comment.