diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,11 +38,11 @@ stage: test image: clovisai/wildfyre-java:latest script: - - ./gradlew --no-daemon findbugsMain findbugsTest + - ./gradlew --no-daemon spotbugsMain spotbugsTest artifacts: paths: - - build/reports/findbugs/main.html - - build/reports/findbugs/test.html + - build/reports/spotbugs/main.html + - build/reports/spotbugs/test.html dokka: stage: test diff --git a/.idea/runConfigurations/Static_Analysis.xml b/.idea/runConfigurations/Static_Analysis.xml new file mode 100644 --- /dev/null +++ b/.idea/runConfigurations/Static_Analysis.xml @@ -0,0 +1,22 @@ + + + + + + + true + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ plugins { id 'java' - id 'findbugs' + id 'com.github.spotbugs' version '1.6.10' id 'signing' // To GPG-sign the archives that will be published. id 'maven' // To export to Maven id 'io.codearte.nexus-staging' version '0.11.0' // Confirm publication to MavenCentral @@ -32,6 +32,8 @@ sourceCompatibility = 1.8 targetCompatibility = 1.8 +def spotbugsVersion = '3.1.12' + void getVersion(){ def stdout = new ByteArrayOutputStream() exec { @@ -63,7 +65,9 @@ testCompile group: 'junit', name: 'junit', version: '4.12' implementation group: 'com.eclipsesource.minimal-json', name: 'minimal-json', version: '0.9.5' fatJar group: 'com.eclipsesource.minimal-json', name: 'minimal-json', version: '0.9.5' - compile 'com.google.code.findbugs:annotations:3.0.1' + compile 'com.github.spotbugs:spotbugs:'+spotbugsVersion + compileOnly 'net.jcip:jcip-annotations:1.0' + compileOnly 'com.github.spotbugs:spotbugs-annotations:'+spotbugsVersion compile 'com.google.code.findbugs:jsr305:3.0.1' compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8" } @@ -82,19 +86,13 @@ maxParallelForks = runners > 0 ? runners : 1 } -tasks.withType(FindBugs) { - reports { - xml.enabled = false - html.enabled = true - } -} - -findbugsMain { - classpath += files Jvm.current().getJavaHome() +spotbugs { + toolVersion = spotbugsVersion } -findbugsTest { - classpath += files Jvm.current().getJavaHome() +tasks.withType(com.github.spotbugs.SpotBugsTask) { + reports.xml.enabled = false + reports.html.enabled = true } // Removes the directories out/ (created by IntelliJ) and wildfyre.net/ (created by the maven plugin) when calling