@CacheableTask public class SpotBugsTask extends org.gradle.api.tasks.SourceTask implements org.gradle.api.tasks.VerificationTask, org.gradle.api.reporting.Reporting<SpotBugsReports>
| Constructor and Description |
|---|
SpotBugsTask() |
| Modifier and Type | Method and Description |
|---|---|
SpotBugsTask |
extraArgs(java.lang.Iterable<java.lang.String> arguments) |
SpotBugsTask |
extraArgs(java.lang.String... arguments) |
org.gradle.api.file.FileCollection |
getClasses()
The classes to be analyzed.
|
org.gradle.api.file.FileCollection |
getClasspath()
Compile class path for the classes to be analyzed.
|
java.lang.String |
getEffort()
The analysis effort level.
|
java.io.File |
getExcludeBugsFilter()
The filename of a filter specifying baseline bugs to exclude from being reported.
|
org.gradle.api.resources.TextResource |
getExcludeBugsFilterConfig()
A filter specifying baseline bugs to exclude from being reported.
|
java.io.File |
getExcludeFilter()
The filename of a filter specifying bugs to exclude from being reported.
|
org.gradle.api.resources.TextResource |
getExcludeFilterConfig()
A filter specifying bugs to exclude from being reported.
|
java.util.Collection<java.lang.String> |
getExtraArgs()
Any additional arguments (not covered here more explicitly like
effort) to be passed along to SpotBugs. |
boolean |
getIgnoreFailures()
Whether or not to allow the build to continue if there are warnings.
|
java.io.File |
getIncludeFilter()
The filename of a filter specifying which bugs are reported.
|
org.gradle.api.resources.TextResource |
getIncludeFilterConfig()
A filter specifying which bugs are reported.
|
org.gradle.internal.reflect.Instantiator |
getInstantiator() |
java.lang.String |
getMaxHeapSize()
The maximum heap size for the forked spotbugs process (ex: '1g').
|
java.util.Collection<java.lang.String> |
getOmitVisitors()
Similar to
visitors except that it specifies bug detectors which should not be run. |
org.gradle.api.file.FileCollection |
getPluginClasspath()
Class path holding any additional SpotBugs plugins.
|
java.lang.String |
getReportLevel()
The priority threshold for reporting bugs.
|
SpotBugsReports |
getReports()
The reports to be generated by this task.
|
org.gradle.api.file.FileTree |
getSource() |
org.gradle.api.file.FileCollection |
getSpotbugsClasspath()
Class path holding the SpotBugs library.
|
java.util.Collection<java.lang.String> |
getVisitors()
The bug detectors which should be run.
|
org.gradle.process.internal.worker.WorkerProcessFactory |
getWorkerProcessBuilderFactory() |
SpotBugsReports |
reports(org.gradle.api.Action<? super SpotBugsReports> configureAction)
Configures the reports to be generated by this task.
|
SpotBugsReports |
reports(groovy.lang.Closure closure)
Configures the reports to be generated by this task.
|
void |
run() |
void |
setClasses(org.gradle.api.file.FileCollection classes) |
void |
setClasspath(org.gradle.api.file.FileCollection classpath) |
void |
setEffort(java.lang.String effort) |
void |
setExcludeBugsFilter(java.io.File filter)
The filename of a filter specifying baseline bugs to exclude from being reported.
|
void |
setExcludeBugsFilterConfig(org.gradle.api.resources.TextResource excludeBugsFilterConfig) |
void |
setExcludeFilter(java.io.File filter)
The filename of a filter specifying bugs to exclude from being reported.
|
void |
setExcludeFilterConfig(org.gradle.api.resources.TextResource excludeFilterConfig) |
void |
setExtraArgs(java.util.Collection<java.lang.String> extraArgs) |
void |
setIgnoreFailures(boolean ignoreFailures) |
void |
setIncludeFilter(java.io.File filter)
The filename of a filter specifying which bugs are reported.
|
void |
setIncludeFilterConfig(org.gradle.api.resources.TextResource includeFilterConfig) |
void |
setMaxHeapSize(java.lang.String maxHeapSize) |
void |
setOmitVisitors(java.util.Collection<java.lang.String> omitVisitors) |
void |
setPluginClasspath(org.gradle.api.file.FileCollection pluginClasspath) |
void |
setReportLevel(java.lang.String reportLevel) |
void |
setSpotbugsClasspath(org.gradle.api.file.FileCollection spotbugsClasspath) |
void |
setVisitors(java.util.Collection<java.lang.String> visitors) |
exclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSetFactory, include, include, include, include, setExcludes, setIncludes, setSource, setSource, sourceconventionMapping, conventionMapping, getConventionMappingaddValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, isHasCustomActions, leftShift, mustRunAfter, newInputFile, newOutputDirectory, newOutputFile, onlyIf, onlyIf, prependParallelSafeAction, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString@Inject public org.gradle.internal.reflect.Instantiator getInstantiator()
@Inject public org.gradle.process.internal.worker.WorkerProcessFactory getWorkerProcessBuilderFactory()
public SpotBugsReports getReports()
getReports in interface org.gradle.api.reporting.Reporting<SpotBugsReports>public SpotBugsReports reports(groovy.lang.Closure closure)
spotbugsTask {
reports {
xml {
destination "build/spotbugs.xml"
}
}
}
reports in interface org.gradle.api.reporting.Reporting<SpotBugsReports>closure - The configurationpublic SpotBugsReports reports(org.gradle.api.Action<? super SpotBugsReports> configureAction)
spotbugsTask {
reports {
xml {
destination "build/spotbugs.xml"
}
}
}
reports in interface org.gradle.api.reporting.Reporting<SpotBugsReports>configureAction - The configuration@Internal public java.io.File getIncludeFilter()
public void setIncludeFilter(java.io.File filter)
filter - filename of a filter specifying which bugs are report@Internal public java.io.File getExcludeFilter()
public void setExcludeFilter(java.io.File filter)
filter - filename of a filter specifying bugs to exclude from being reported@Internal public java.io.File getExcludeBugsFilter()
public void setExcludeBugsFilter(java.io.File filter)
filter - filename of a filter specifying baseline bugs to exclude from being reportedpublic void run()
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOExceptionjava.lang.InterruptedExceptionpublic SpotBugsTask extraArgs(java.lang.Iterable<java.lang.String> arguments)
public SpotBugsTask extraArgs(java.lang.String... arguments)
@PathSensitive(value=RELATIVE) public org.gradle.api.file.FileTree getSource()
getSource in class org.gradle.api.tasks.SourceTask@SkipWhenEmpty @PathSensitive(value=RELATIVE) @InputFiles public org.gradle.api.file.FileCollection getClasses()
public void setClasses(org.gradle.api.file.FileCollection classes)
classes - classes to be analyzed@Classpath public org.gradle.api.file.FileCollection getClasspath()
public void setClasspath(org.gradle.api.file.FileCollection classpath)
classpath - compile class path for the classes to be analyze@Classpath public org.gradle.api.file.FileCollection getSpotbugsClasspath()
public void setSpotbugsClasspath(org.gradle.api.file.FileCollection spotbugsClasspath)
spotbugsClasspath - class path holding the SpotBugs library@Classpath public org.gradle.api.file.FileCollection getPluginClasspath()
public void setPluginClasspath(org.gradle.api.file.FileCollection pluginClasspath)
pluginClasspath - class path holding any additional SpotBugs plugin@Input public boolean getIgnoreFailures()
getIgnoreFailures in interface org.gradle.api.tasks.VerificationTaskpublic void setIgnoreFailures(boolean ignoreFailures)
setIgnoreFailures in interface org.gradle.api.tasks.VerificationTask@Input @Optional public java.lang.String getEffort()
min, default, or max.
Higher levels increase precision and find more bugs at the expense of running time and memory consumption.public void setEffort(java.lang.String effort)
effort - analysis effort level@Input @Optional public java.lang.String getReportLevel()
low, all bugs are reported. If set to medium
(the default), medium and high priority bugs are reported. If set to high, only high priority bugs are reported.public void setReportLevel(java.lang.String reportLevel)
reportLevel - priority threshold for reporting bugs@Input @Optional public java.lang.String getMaxHeapSize()
public void setMaxHeapSize(java.lang.String maxHeapSize)
maxHeapSize - maximum heap size@Input @Optional public java.util.Collection<java.lang.String> getVisitors()
public void setVisitors(java.util.Collection<java.lang.String> visitors)
visitors - bug detectors which should be run@Input @Optional public java.util.Collection<java.lang.String> getOmitVisitors()
visitors except that it specifies bug detectors which should not be run. By default, no
visitors are omitted.public void setOmitVisitors(java.util.Collection<java.lang.String> omitVisitors)
omitVisitors - bug detectors which should not be run@Incubating @Optional public org.gradle.api.resources.TextResource getIncludeFilterConfig()
includeFilter property.public void setIncludeFilterConfig(org.gradle.api.resources.TextResource includeFilterConfig)
includeFilterConfig - filter specifying which bugs are reported@Incubating @Optional public org.gradle.api.resources.TextResource getExcludeFilterConfig()
excludeFilter property.public void setExcludeFilterConfig(org.gradle.api.resources.TextResource excludeFilterConfig)
excludeFilterConfig - filter specifying bugs to exclude from being reported@Incubating @Optional public org.gradle.api.resources.TextResource getExcludeBugsFilterConfig()
public void setExcludeBugsFilterConfig(org.gradle.api.resources.TextResource excludeBugsFilterConfig)
excludeBugsFilterConfig - filter specifying baseline bugs to exclude from being reported@Input @Optional public java.util.Collection<java.lang.String> getExtraArgs()
effort) to be passed along to SpotBugs.
Extra arguments are passed to SpotBugs after the arguments Gradle understands (like effort but before the
list of classes to analyze. This should only be used for arguments that cannot be provided by Gradle directly.
Gradle does not try to interpret or validate the arguments before passing them to SpotBugs.
See the SpotBugs TextUICommandLine source for available options.
effort) to be passed along to
SpotBugspublic void setExtraArgs(java.util.Collection<java.lang.String> extraArgs)
extraArgs - any additional arguments (not covered here more explicitly like effort) to be passed along to
SpotBugs