diff --git a/plugin/src/main/groovy/com/novoda/staticanalysis/StaticAnalysisPlugin.groovy b/plugin/src/main/groovy/com/novoda/staticanalysis/StaticAnalysisPlugin.groovy index 36f1719..cf45d3d 100644 --- a/plugin/src/main/groovy/com/novoda/staticanalysis/StaticAnalysisPlugin.groovy +++ b/plugin/src/main/groovy/com/novoda/staticanalysis/StaticAnalysisPlugin.groovy @@ -3,7 +3,7 @@ package com.novoda.staticanalysis import com.novoda.staticanalysis.internal.Configurator import com.novoda.staticanalysis.internal.checkstyle.CheckstyleConfigurator import com.novoda.staticanalysis.internal.detekt.DetektConfigurator -import com.novoda.staticanalysis.internal.findbugs.FindbugsConfigurator +import com.novoda.staticanalysis.internal.findbugs.FindbugsConfiguratorFactory import com.novoda.staticanalysis.internal.ktlint.KtlintConfigurator import com.novoda.staticanalysis.internal.lint.LintConfigurator import com.novoda.staticanalysis.internal.pmd.PmdConfigurator @@ -42,7 +42,7 @@ class StaticAnalysisPlugin implements Plugin { [ CheckstyleConfigurator.create(project, violationsContainer, evaluateViolations), PmdConfigurator.create(project, violationsContainer, evaluateViolations), - FindbugsConfigurator.create(project, violationsContainer, evaluateViolations), + FindbugsConfiguratorFactory.create(project, violationsContainer, evaluateViolations), SpotBugsConfigurator.create(project, violationsContainer, evaluateViolations), DetektConfigurator.create(project, violationsContainer, evaluateViolations), KtlintConfigurator.create(project, violationsContainer, evaluateViolations), diff --git a/plugin/src/main/groovy/com/novoda/staticanalysis/internal/findbugs/FindbugsConfigurator.groovy b/plugin/src/main/groovy/com/novoda/staticanalysis/internal/findbugs/FindbugsConfigurator.groovy index 658ce08..fb86873 100644 --- a/plugin/src/main/groovy/com/novoda/staticanalysis/internal/findbugs/FindbugsConfigurator.groovy +++ b/plugin/src/main/groovy/com/novoda/staticanalysis/internal/findbugs/FindbugsConfigurator.groovy @@ -4,7 +4,6 @@ import com.novoda.staticanalysis.Violations import com.novoda.staticanalysis.internal.CodeQualityConfigurator import org.gradle.api.Action import org.gradle.api.DomainObjectSet -import org.gradle.api.NamedDomainObjectContainer import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.file.FileCollection @@ -24,17 +23,7 @@ class FindbugsConfigurator extends CodeQualityConfigurator violationsContainer, - Task evaluateViolations) { - Violations violations = violationsContainer.maybeCreate('Findbugs') - return new FindbugsConfigurator(project, violations, evaluateViolations) - } - - private FindbugsConfigurator(Project project, - Violations violations, - Task evaluateViolations) { + FindbugsConfigurator(Project project, Violations violations, Task evaluateViolations) { super(project, violations, evaluateViolations) } diff --git a/plugin/src/main/groovy/com/novoda/staticanalysis/internal/findbugs/FindbugsConfiguratorFactory.groovy b/plugin/src/main/groovy/com/novoda/staticanalysis/internal/findbugs/FindbugsConfiguratorFactory.groovy new file mode 100644 index 0000000..ed086f2 --- /dev/null +++ b/plugin/src/main/groovy/com/novoda/staticanalysis/internal/findbugs/FindbugsConfiguratorFactory.groovy @@ -0,0 +1,20 @@ +package com.novoda.staticanalysis.internal.findbugs + +import com.novoda.staticanalysis.Violations +import org.gradle.api.NamedDomainObjectContainer +import org.gradle.api.Project +import org.gradle.api.Task + +@Deprecated +class FindbugsConfiguratorFactory { + + private FindbugsConfiguratorFactory() { + } + + static FindbugsConfigurator create(Project project, + NamedDomainObjectContainer violationsContainer, + Task evaluateViolations) { + Violations violations = violationsContainer.maybeCreate('Findbugs') + return new FindbugsConfigurator(project, violations, evaluateViolations) + } +}