Added spotbugs and errorprone plugins.

This commit is contained in:
Erik C. Thauvin 2018-07-11 03:33:42 -07:00
parent 05531406a9
commit dc82c66d68
3 changed files with 27 additions and 1 deletions

View file

@ -4,8 +4,12 @@ plugins {
id "com.jfrog.bintray" version "1.8.3" id "com.jfrog.bintray" version "1.8.3"
id "com.github.ben-manes.versions" version "0.20.0" id "com.github.ben-manes.versions" version "0.20.0"
id "net.thauvin.erik.gradle.semver" version "0.9.5-beta" id "net.thauvin.erik.gradle.semver" version "0.9.5-beta"
id "com.github.spotbugs" version "1.6.2"
id "net.ltgt.errorprone" version "0.0.14"
} }
import com.github.spotbugs.SpotBugsTask
import org.apache.tools.ant.taskdefs.condition.Os import org.apache.tools.ant.taskdefs.condition.Os
defaultTasks 'check' defaultTasks 'check'
@ -35,6 +39,7 @@ repositories {
dependencies { dependencies {
compile 'com.github.spullara.mustache.java:compiler:0.9.5' compile 'com.github.spullara.mustache.java:compiler:0.9.5'
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.7.1'
testCompile 'org.testng:testng:6.14.3' testCompile 'org.testng:testng:6.14.3'
} }
@ -137,6 +142,13 @@ test {
useTestNG() useTestNG()
} }
tasks.withType(SpotBugsTask) {
reports {
xml.enabled = false
html.enabled = true
}
excludeFilter = file("$projectDir/config/spotbugs/excludeFilter.xml")
}
compileJava { compileJava {
options.compilerArgs.add('-proc:none') options.compilerArgs.add('-proc:none')
} }

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter
xmlns="https://github.com/spotbugs/filter/3.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">
<Match>
<Class name="net.thauvin.erik.semver.VersionProcessor"/>
<Or>
<Method name="writeTemplate"/>
<Method name="findValues"/>
</Or>
<Bug code="SECPTI"/>
</Match>
</FindBugsFilter>

View file

@ -159,7 +159,7 @@ public class VersionInfoTest {
} }
} }
@SuppressWarnings("ClassExplicitlyAnnotation") @SuppressWarnings({"ClassExplicitlyAnnotation", "BadAnnotationImplementation"})
class VersionTest implements Version { class VersionTest implements Version {
@Override @Override
public Class<? extends Annotation> annotationType() { public Class<? extends Annotation> annotationType() {