From 035e59e99ec0bffbc0671c808cb33b83ce7b047a Mon Sep 17 00:00:00 2001 From: Vest Date: Sat, 6 Apr 2024 22:53:50 +0100 Subject: [PATCH] Updated Spotbugs Plugin to 6.0.9 (the solution was taken from https://github.com/spotbugs/spotbugs-gradle-plugin/issues/972#issuecomment-1769247750) --- build.gradle | 4 ++-- code/gradle/reporting.gradle | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 5617db46f43..86d31ab7017 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ plugins { id 'application' // Creating application bundles id 'build-dashboard' // Produces a build report id 'checkstyle' // Checkstyle for Java, configured further below - id "com.github.spotbugs" version '5.2.5' // Spotbugs for Java + id "com.github.spotbugs" version '6.0.9' // Spotbugs for Java id 'java' // Core java / javac id 'maven-publish' // Publishing to Maven Central id 'pmd' // PMD for Java, configured further below @@ -33,7 +33,7 @@ plugins { id 'edu.sc.seis.launch4j' version '3.0.5' // Creates launch4j id 'com.github.ben-manes.versions' version '0.51.0' // Checks versions for plugins and dependencies id "com.dorongold.task-tree" version '3.0.0' // Prints the task dependency tree - id 'org.openjfx.javafxplugin' version '0.1.0' // JavaFX support + id 'org.openjfx.javafxplugin' version '0.1.0' // JavaFX support id 'org.beryx.runtime' version '1.13.1' // Creates custom runtimes } diff --git a/code/gradle/reporting.gradle b/code/gradle/reporting.gradle index 7bc6765ca05..999b3103101 100644 --- a/code/gradle/reporting.gradle +++ b/code/gradle/reporting.gradle @@ -25,21 +25,24 @@ pmd { // TODO fix the outstanding bugs and then remove the ignoreFailures spotbugs { + def classLoader = plugins["com.github.spotbugs"].class.classLoader + def SpotBugsConfidence = classLoader.findLoadedClass("com.github.spotbugs.snom.Confidence") + toolVersion = '4.8.3' excludeFilter = file("$rootProject.projectDir/code/standards/spotbugs_ignore.xml") omitVisitors = ['Naming', 'CrossSiteScripting', 'DontUseEnum', 'DoInsideDoPrivileged'] - reportLevel = 'low' + reportLevel = SpotBugsConfidence.LOW ignoreFailures = true } spotbugsMain { reports { - xml.enabled = false - html.enabled = true + xml.required = false + html.required = true html.stylesheet resources.text.fromFile('code/standards/fancy-hist.xsl') } } -task allReports { +tasks.register('allReports') { dependsOn = ['checkstyleMain', 'pmdMain', 'spotbugsMain'] }