diff --git a/gradle.properties b/gradle.properties index c65ea39f94..b60fa2f805 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,7 +21,6 @@ artifactIdGradle=spotless-plugin-gradle # Build requirements VER_JAVA=11 -VER_SPOTBUGS=4.7.3 VER_JSR_305=3.0.2 # Dependencies provided by Spotless plugin diff --git a/gradle/java-setup.gradle b/gradle/java-setup.gradle index 5a1e23ef0a..b152097653 100644 --- a/gradle/java-setup.gradle +++ b/gradle/java-setup.gradle @@ -14,11 +14,14 @@ tasks.withType(JavaCompile).configureEach { ////////////// apply plugin: 'com.github.spotbugs' spotbugs { - toolVersion = VER_SPOTBUGS ignoreFailures = false // bug free or it doesn't ship! reportLevel = 'medium' // low|medium|high (low = sensitive to even minor mistakes) omitVisitors = [ - 'FindReturnRef'] // https://spotbugs.readthedocs.io/en/latest/detectors.html#findreturnref + // https://spotbugs.readthedocs.io/en/latest/detectors.html#constructorthrow + 'ConstructorThrow', + // https://spotbugs.readthedocs.io/en/latest/detectors.html#findreturnref + 'FindReturnRef', + ] } tasks.named('spotbugsTest') { enabled = false @@ -30,16 +33,10 @@ tasks.withType(com.github.spotbugs.snom.SpotBugsTask).configureEach { reports { html.enabled = true } - notCompatibleWithConfigurationCache("https://github.com/spotbugs/spotbugs-gradle-plugin/issues/670") } -tasks.named('spotbugsMain') { - reports { - html.enabled = true - } -} dependencies { compileOnly 'net.jcip:jcip-annotations:1.0' - compileOnly "com.github.spotbugs:spotbugs-annotations:${VER_SPOTBUGS}" + compileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugs.toolVersion.get()}" compileOnly "com.google.code.findbugs:jsr305:${VER_JSR_305}" } diff --git a/lib-extra/build.gradle b/lib-extra/build.gradle index 07135ff726..e6524f76bf 100644 --- a/lib-extra/build.gradle +++ b/lib-extra/build.gradle @@ -56,16 +56,16 @@ for (needsP2 in NEEDS_P2_DEPS) { add("${needsP2}CompileOnly", "dev.equo.ide:solstice:${VER_SOLSTICE}") } } -jar { + +def jar = tasks.named('jar', Jar) { for (needsP2 in NEEDS_P2_DEPS) { - from sourceSets.getByName(needsP2).output.classesDirs + from sourceSets.named(needsP2).map { it.output.classesDirs } } } + tasks.withType(Test).configureEach { dependsOn jar - doFirst { - classpath += jar.outputs.files - } + classpath += jar.get().outputs.files } apply plugin: 'dev.equo.p2deps' diff --git a/settings.gradle b/settings.gradle index e7b9649cf3..e7e5a6d4ea 100644 --- a/settings.gradle +++ b/settings.gradle @@ -12,7 +12,7 @@ plugins { // https://github.com/gradle-nexus/publish-plugin/releases id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' apply false // https://github.com/spotbugs/spotbugs-gradle-plugin/releases - id 'com.github.spotbugs' version '5.2.1' apply false + id 'com.github.spotbugs' version '5.2.3' apply false // https://github.com/diffplug/spotless-changelog/blob/main/CHANGELOG.md id 'com.diffplug.spotless-changelog' version '3.0.2' apply false // https://github.com/diffplug/goomph/blob/main/CHANGES.md