Open xenoterracide opened 3 years ago
I cannot reproduce this problem by the following test:
diff --git a/src/functionalTest/groovy/com/github/spotbugs/snom/StandardFunctionalTest.groovy b/src/functionalTest/groovy/com/github/spotbugs/snom/StandardFunctionalTest.groovy
index 31814c4..03f3327 100644
--- a/src/functionalTest/groovy/com/github/spotbugs/snom/StandardFunctionalTest.groovy
+++ b/src/functionalTest/groovy/com/github/spotbugs/snom/StandardFunctionalTest.groovy
@@ -61,6 +61,31 @@ public class Foo {
"""
}
+ /**
+ * @see <a href="https://github.com/spotbugs/spotbugs-gradle-plugin/issues/517">The reported GitHub issue</a>
+ */
+ def "should be possible to disable"() {
+ setup:
+ buildFile << """
+tasks.withType(com.github.spotbugs.snom.SpotBugsTask) {
+ enabled = false
+}
+"""
+ when:
+ BuildResult result =
+ GradleRunner.create()
+ .withProjectDir(rootDir)
+ .withArguments(":spotbugsMain")
+ .withPluginClasspath()
+ .forwardOutput()
+ .withGradleVersion(version)
+ .build()
+
+ then:
+ result.task(":classes").outcome == TaskOutcome.SUCCESS
+ result.task(":spotbugsMain").outcome == TaskOutcome.SKIPPED
+ }
+
def "can create spotbugsMain task depending on classes task"() {
when:
BuildResult result =
@xenoterracide I found that the tasks
does not list tasks created by the SpotBugs plugin.
git clone git@github.com:xenoterracide/iw-ppm-backend.git
cd iw-ppm-backend
git checkout f9612cdc0a84d832cb592fed619a059d0a62fb44
.\gradlew.bat :authn:tasks
It means that no task exists during the configuration phase, isn't it? I guess your project or Gradle's feature previews probably have problem around the project lifecycle.
It means that no task exists during the configuration phase, isn't it?
Oops, it's not true. We have no listed tasks because of #467
@xenoterracide I've solved #467 so want to reproduce this issue again. could you make a commit depending on the latest spotbugs-gradle-plugin:4.7.6 in your project?
I'm not familiar with the dependency locking, not sure how I should update that project.
encountered an issue running spotbugs in one module, long story short, the only way I've found to disable spotbugs for that module was to completely remove my plugin that enabled it. I'm not even sure if this could be a bug in your code, since
enabled
should only be provided by the plugin base, IIRC. At the same time it seems like the only other place would be gradle itselfhttps://github.com/xenoterracide/iw-ppm-backend/blob/f9612cdc0a84d832cb592fed619a059d0a62fb44/module/authn/build.gradle.kts