Skip to content

Commit

Permalink
Remove findbugs completely
Browse files Browse the repository at this point in the history
  • Loading branch information
Sloy committed May 17, 2019
1 parent 5b295df commit 7dc3310
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1,170 deletions.
73 changes: 2 additions & 71 deletions config/android-quality.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
apply plugin: 'pmd'
apply plugin: 'findbugs'
apply plugin: 'checkstyle'

def isTravis = "true".equals(System.getenv("TRAVIS"))
Expand All @@ -8,11 +7,6 @@ pmd {
ruleSetFiles = files("${project.rootDir}/config/pmd/pmd-ruleset.xml")
}

findbugs {
includeFilter = file("${project.rootDir}/config/findbugs/findbugs-config.xml")
excludeFilter = file("${project.rootDir}/config/findbugs/findbugs-excludes.xml")
}

checkstyle {
toolVersion = "7.1.1"
showViolations isTravis
Expand Down Expand Up @@ -40,71 +34,8 @@ task pmd(type: Pmd) {
}


// Excludes based on https://github.com/ChaitanyaPramod/findbugs-android
def androidDataBindingExcludes =
['android/databinding/**/*.class',
'**/android/databinding/*Binding.class',
'**/BR.*'].asImmutable()

def Collection<String> androidExcludes =
['**/R.class',
'**/R$*.class',
'**/BuildConfig.*',
'**/Manifest*.*',
'**/*.bin'
].asImmutable()

def Collection<String> butterKnifeExcludes =
['**/*$ViewInjector*.*',
'**/*$ViewBinder*.*'].asImmutable()

def Collection<String> dagger2Excludes =
['**/*_MembersInjector.class',
'**/Dagger*Component.class',
'**/Dagger*Component$Builder.class',
'**/*Module_*Factory.class'].asImmutable()

def Collection<String> defaultExcludes =
(androidDataBindingExcludes + androidExcludes + butterKnifeExcludes + dagger2Excludes)
.asImmutable()

getVariants().all { variant ->
task("findbugs${variant.name.capitalize()}", type: FindBugs) {
description "Analyze ${variant.name} code with the findbugs tool"
group "Verification"

source = variant.javaCompile.source
classes = project.fileTree(dir: variant.javaCompile.destinationDir, excludes: defaultExcludes)
classpath = variant.javaCompile.classpath

reports {
xml.enabled = isTravis
html.enabled = !isTravis
}
dependsOn variant.javaCompile
}
}

task findbugs() {
description "Analyze code with the findbugs tool"
group "Verification"

dependsOn tasks.withType(FindBugs)
}

task checkstyle(type: Checkstyle) {
description 'Run checkstyle'
group 'verification'

configFile file("${project.rootDir}/config/checkstyle/checkstyle.xml")
configProperties = [rootDir: "${project.rootDir}"]
source 'src'
include '**/*.java'
exclude '**/gen/**'
classpath = files()
}

check.dependsOn 'checkstyle', 'findbugs', 'pmd', 'lint'
// Exclude
check.dependsOn 'checkstyle', 'pmd', 'lint'

apply plugin: 'jacoco'

Expand Down
Loading

0 comments on commit 7dc3310

Please sign in to comment.