Merge pull request #22 from brarcher/findbugs

enable findbugs in travis-ci build
This commit is contained in:
Branden Archer
2016-02-20 16:29:24 -05:00
4 changed files with 39 additions and 2 deletions

View File

@@ -19,7 +19,9 @@ android:
# if you need to run emulator(s) during your tests
- sys-img-x86-android-17
script: gradle build lint test
script: gradle build lint findbugs test
after_failure:
- cat app/build/outputs/lint-results.xml
- cat app/build/reports/findbugs/findbugs.html
- cat app/build/reports/tests/debug/index.html

View File

@@ -1,4 +1,10 @@
apply plugin: 'com.android.application'
apply plugin: 'findbugs'
findbugs {
sourceSets = []
ignoreFailures = false
}
android {
compileSdkVersion 23
@@ -36,3 +42,22 @@ dependencies {
testCompile 'junit:junit:4.12'
testCompile "org.robolectric:robolectric:3.0"
}
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>

View File

@@ -12,7 +12,7 @@ public class DBHelper extends SQLiteOpenHelper
public static final String DATABASE_NAME = "LoyaltyCards.db";
public static final int DATABASE_VERSION = 1;
class LoyaltyCardDbIds
static class LoyaltyCardDbIds
{
public static final String TABLE = "cards";
public static final String ID = "_id";