@CacheableTask public class FindBugs extends SourceTask implements VerificationTask, Reporting<FindBugsReports>
Task.Namer
source
TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
Constructor and Description |
---|
FindBugs() |
Modifier and Type | Method and Description |
---|---|
FindBugs |
extraArgs(Iterable<String> arguments) |
FindBugs |
extraArgs(String... arguments) |
FileCollection |
getClasses()
The classes to be analyzed.
|
FileCollection |
getClasspath()
Compile class path for the classes to be analyzed.
|
String |
getEffort()
The analysis effort level.
|
File |
getExcludeBugsFilter()
The filename of a filter specifying baseline bugs to exclude from being reported.
|
TextResource |
getExcludeBugsFilterConfig()
A filter specifying baseline bugs to exclude from being reported.
|
File |
getExcludeFilter()
The filename of a filter specifying bugs to exclude from being reported.
|
TextResource |
getExcludeFilterConfig()
A filter specifying bugs to exclude from being reported.
|
Collection<String> |
getExtraArgs()
Any additional arguments (not covered here more explicitly like
effort ) to be passed along to FindBugs. |
FileCollection |
getFindbugsClasspath()
Class path holding the FindBugs library.
|
boolean |
getIgnoreFailures()
Whether or not to allow the build to continue if there are warnings.
|
File |
getIncludeFilter()
The filename of a filter specifying which bugs are reported.
|
TextResource |
getIncludeFilterConfig()
A filter specifying which bugs are reported.
|
org.gradle.internal.reflect.Instantiator |
getInstantiator() |
String |
getMaxHeapSize()
The maximum heap size for the forked findbugs process (ex: '1g').
|
Collection<String> |
getOmitVisitors()
Similar to
visitors except that it specifies bug detectors which should not be run. |
FileCollection |
getPluginClasspath()
Class path holding any additional FindBugs plugins.
|
String |
getReportLevel()
The priority threshold for reporting bugs.
|
FindBugsReports |
getReports()
The reports to be generated by this task.
|
FileTree |
getSource()
Returns the source for this task, after the include and exclude patterns have been applied.
|
Collection<String> |
getVisitors()
The bug detectors which should be run.
|
org.gradle.process.internal.worker.WorkerProcessFactory |
getWorkerProcessBuilderFactory() |
FindBugsReports |
reports(Action<? super FindBugsReports> configureAction)
Configures the reports to be generated by this task.
|
FindBugsReports |
reports(Closure closure)
Configures the reports to be generated by this task.
|
void |
run() |
void |
setClasses(FileCollection classes) |
void |
setClasspath(FileCollection classpath) |
void |
setEffort(String effort) |
void |
setExcludeBugsFilter(File filter)
The filename of a filter specifying baseline bugs to exclude from being reported.
|
void |
setExcludeBugsFilterConfig(TextResource excludeBugsFilterConfig) |
void |
setExcludeFilter(File filter)
The filename of a filter specifying bugs to exclude from being reported.
|
void |
setExcludeFilterConfig(TextResource excludeFilterConfig) |
void |
setExtraArgs(Collection<String> extraArgs) |
void |
setFindbugsClasspath(FileCollection findbugsClasspath) |
void |
setIgnoreFailures(boolean ignoreFailures)
Specifies whether the build should break when the verifications performed by this task fail.
|
void |
setIncludeFilter(File filter)
The filename of a filter specifying which bugs are reported.
|
void |
setIncludeFilterConfig(TextResource includeFilterConfig) |
void |
setMaxHeapSize(String maxHeapSize) |
void |
setOmitVisitors(Collection<String> omitVisitors) |
void |
setPluginClasspath(FileCollection pluginClasspath) |
void |
setReportLevel(String reportLevel) |
void |
setVisitors(Collection<String> visitors) |
exclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSetFactory, include, include, include, include, setExcludes, setIncludes, setSource, source
conventionMapping, conventionMapping, getConventionMapping
addValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, finalizedBy, getActionClassLoaders, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, 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, 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 FindBugsReports getReports()
getReports
in interface Reporting<FindBugsReports>
public FindBugsReports reports(Closure closure)
findbugsTask { reports { xml { destination "build/findbugs.xml" } } }
reports
in interface Reporting<FindBugsReports>
closure
- The configurationpublic FindBugsReports reports(Action<? super FindBugsReports> configureAction)
findbugsTask { reports { xml { destination "build/findbugs.xml" } } }
reports
in interface Reporting<FindBugsReports>
configureAction
- The configuration@Internal public File getIncludeFilter()
public void setIncludeFilter(File filter)
@Internal public File getExcludeFilter()
public void setExcludeFilter(File filter)
@Internal public File getExcludeBugsFilter()
public void setExcludeBugsFilter(File filter)
public void run() throws IOException, InterruptedException
IOException
InterruptedException
@PathSensitive(value=RELATIVE) public FileTree getSource()
getSource
in class SourceTask
@SkipWhenEmpty @PathSensitive(value=RELATIVE) @InputFiles public FileCollection getClasses()
public void setClasses(FileCollection classes)
@Classpath public FileCollection getClasspath()
public void setClasspath(FileCollection classpath)
@Classpath public FileCollection getFindbugsClasspath()
public void setFindbugsClasspath(FileCollection findbugsClasspath)
@Classpath public FileCollection getPluginClasspath()
public void setPluginClasspath(FileCollection pluginClasspath)
@Input public boolean getIgnoreFailures()
getIgnoreFailures
in interface VerificationTask
public void setIgnoreFailures(boolean ignoreFailures)
VerificationTask
setIgnoreFailures
in interface VerificationTask
ignoreFailures
- false to break the build on failure, true to ignore the failures. The default is false.@Input @Optional public 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(String effort)
@Input @Optional public 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(String reportLevel)
@Input @Optional public String getMaxHeapSize()
public void setMaxHeapSize(String maxHeapSize)
@Input @Optional public Collection<String> getVisitors()
public void setVisitors(Collection<String> visitors)
@Input @Optional public Collection<String> getOmitVisitors()
visitors
except that it specifies bug detectors which should not be run. By default, no visitors are omitted.public void setOmitVisitors(Collection<String> omitVisitors)
@Incubating @Optional public TextResource getIncludeFilterConfig()
includeFilter
property.public void setIncludeFilterConfig(TextResource includeFilterConfig)
@Incubating @Optional public TextResource getExcludeFilterConfig()
excludeFilter
property.public void setExcludeFilterConfig(TextResource excludeFilterConfig)
@Incubating @Optional public TextResource getExcludeBugsFilterConfig()
public void setExcludeBugsFilterConfig(TextResource excludeBugsFilterConfig)
@Input @Optional public Collection<String> getExtraArgs()
effort
) to be passed along to FindBugs. Extra arguments are passed to FindBugs 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 FindBugs.
See the FindBugs TextUICommandLine source for available options.
public void setExtraArgs(Collection<String> extraArgs)