Rudimentary migration of findbugs to spotbugs

This commit is contained in:
TacoTheDank
2020-12-26 20:34:44 -05:00
parent a21e9f142c
commit 319ba195e4
4 changed files with 20 additions and 17 deletions

View File

@@ -23,5 +23,5 @@ jobs:
run: ./gradlew lintRelease
- name: Run unit tests
run: ./gradlew testReleaseUnitTest
- name: FindBugs
run: ./gradlew findbugs
- name: SpotBugs
run: ./gradlew spotbugs

View File

@@ -1,9 +1,13 @@
apply plugin: 'com.android.application'
apply plugin: 'findbugs'
import com.github.spotbugs.snom.SpotBugsTask
findbugs {
sourceSets = []
apply plugin: 'com.android.application'
apply plugin: 'com.github.spotbugs'
spotbugs {
ignoreFailures = false
effort = 'max'
excludeFilter = file("./config/spotbugs/exclude.xml")
reportsDir = file("$buildDir/reports/spotbugs/")
}
android {
@@ -73,18 +77,14 @@ dependencies {
testImplementation 'org.robolectric:robolectric:4.0.2'
}
task findbugs(type: FindBugs, dependsOn: 'assembleDebug') {
tasks.withType(SpotBugsTask) {
description 'Run findbugs'
description 'Run spotbugs'
group 'verification'
classes = fileTree('build/intermediates/javac/debug/compileDebugJavaWithJavac/classes')
source = fileTree('src/main/java')
classpath = files()
effort = 'max'
excludeFilter = file("./config/findbugs/exclude.xml")
//classes = fileTree('build/intermediates/javac/debug/compileDebugJavaWithJavac/classes')
//source = fileTree('src/main/java')
//classpath = files()
reports {
xml.enabled = false

View File

@@ -1,4 +1,4 @@
<FindBugsFilter>
<SpotBugsFilter>
<Match>
<Class name="~.*R\$.*"/>
@@ -7,4 +7,4 @@
<Class name="~.*Manifest\$.*"/>
</Match>
</FindBugsFilter>
</SpotBugsFilter>

View File

@@ -5,10 +5,12 @@ buildscript {
google()
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.6.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -20,6 +22,7 @@ allprojects {
google()
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://plugins.gradle.org/m2/" }
}
}