Class FindBugs
- All Implemented Interfaces:
Comparable<Task>
,org.gradle.api.internal.DynamicObjectAware
,org.gradle.api.internal.IConventionAware
,org.gradle.api.internal.TaskInternal
,ExtensionAware
,Reporting<FindBugsReports>
,Task
,PatternFilterable
,VerificationTask
,org.gradle.util.Configurable<Task>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Task
Task.Namer
-
Field Summary
Fields inherited from class org.gradle.api.tasks.SourceTask
source
Fields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAny additional arguments (not covered here more explicitly likeeffort
) to be passed along to FindBugs.Any additional arguments (not covered here more explicitly likeeffort
) to be passed along to FindBugs.protected FileCollection
The classes to be analyzed.The class directories to be analyzed.Compile class path for the classes to be analyzed.The analysis effort level.The filename of a filter specifying baseline bugs to exclude from being reported.A filter specifying baseline bugs to exclude from being reported.The filename of a filter specifying bugs to exclude from being reported.A filter specifying bugs to exclude from being reported.Any additional arguments (not covered here more explicitly likeeffort
) to be passed along to FindBugs.Class path holding the FindBugs library.boolean
Whether to allow the build to continue if there are warnings.The filename of a filter specifying which bugs are reported.A filter specifying which bugs are reported.Any additional arguments to be passed along to FindBugs JVM process.The maximum heap size for the forked findbugs process (ex: '1g').Injects and returns an instance ofObjectFactory
.Similar tovisitors
except that it specifies bug detectors which should not be run.Class path holding any additional FindBugs plugins.The priority threshold for reporting bugs.The reports to be generated by this task.boolean
Indicates whether analysis progress should be rendered on standard output.Returns the source for this task, after the include and exclude patterns have been applied.The bug detectors which should be run.org.gradle.process.internal.worker.WorkerProcessFactory
Any additional arguments to be passed along to FindBugs JVM process.Any additional arguments to be passed along to FindBugs JVM process.Configures the reports to be generated by this task.reports
(Action<? super FindBugsReports> configureAction) Configures the reports to be generated by this task.void
run()
void
setClasses
(FileCollection classes) The class directories to be analyzed.void
setClasspath
(FileCollection classpath) Compile class path for the classes to be analyzed.void
The analysis effort level.void
setExcludeBugsFilter
(File filter) The filename of a filter specifying baseline bugs to exclude from being reported.void
setExcludeBugsFilterConfig
(TextResource excludeBugsFilterConfig) A filter specifying baseline bugs to exclude from being reported.void
setExcludeFilter
(File filter) The filename of a filter specifying bugs to exclude from being reported.void
setExcludeFilterConfig
(TextResource excludeFilterConfig) A filter specifying bugs to exclude from being reported.void
setExtraArgs
(Collection<String> extraArgs) Any additional arguments (not covered here more explicitly likeeffort
) to be passed along to FindBugs.void
setFindbugsClasspath
(FileCollection findbugsClasspath) Class path holding the FindBugs library.void
setIgnoreFailures
(boolean ignoreFailures) Whether to allow the build to continue if there are warnings.void
setIncludeFilter
(File filter) The filename of a filter specifying which bugs are reported.void
setIncludeFilterConfig
(TextResource includeFilterConfig) A filter specifying which bugs are reported.void
setJvmArgs
(Collection<String> jvmArgs) Any additional arguments to be passed along to FindBugs JVM process.void
setMaxHeapSize
(String maxHeapSize) The maximum heap size for the forked findbugs process (ex: '1g').void
setOmitVisitors
(Collection<String> omitVisitors) Similar tovisitors
except that it specifies bug detectors which should not be run.void
setPluginClasspath
(FileCollection pluginClasspath) Class path holding any additional FindBugs plugins.void
setReportLevel
(String reportLevel) The priority threshold for reporting bugs.void
setShowProgress
(boolean showProgress) Indicates whether analysis progress should be rendered on standard output.void
setVisitors
(Collection<String> visitors) The bug detectors which should be run.Methods inherited from class org.gradle.api.tasks.SourceTask
exclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSetFactory, include, include, include, include, setExcludes, setIncludes, setSource, setSource, source
Methods inherited from class org.gradle.api.internal.ConventionTask
conventionMapping, conventionMapping, getConventionMapping
Methods inherited from class org.gradle.api.DefaultTask
newInputDirectory, newInputFile, newOutputDirectory, newOutputFile
Methods inherited from class org.gradle.api.internal.AbstractTask
addValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doFirst, doLast, doLast, doLast, execute, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLocalState, 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
-
Constructor Details
-
FindBugs
public FindBugs()
-
-
Method Details
-
getObjectFactory
Injects and returns an instance ofObjectFactory
.- Since:
- 4.2
-
getWorkerProcessBuilderFactory
@Inject public org.gradle.process.internal.worker.WorkerProcessFactory getWorkerProcessBuilderFactory() -
getReports
The reports to be generated by this task.- Specified by:
getReports
in interfaceReporting<FindBugsReports>
- Returns:
- The reports container
-
reports
Configures the reports to be generated by this task. The contained reports can be configured by name and closures. Example:findbugsTask { reports { xml { destination "build/findbugs.xml" } } }
- Specified by:
reports
in interfaceReporting<FindBugsReports>
- Parameters:
closure
- The configuration- Returns:
- The reports container
-
reports
Configures the reports to be generated by this task. The contained reports can be configured by name and closures. Example:findbugsTask { reports { xml { destination "build/findbugs.xml" } } }
- Specified by:
reports
in interfaceReporting<FindBugsReports>
- Parameters:
configureAction
- The configuration- Returns:
- The reports container
-
getIncludeFilter
The filename of a filter specifying which bugs are reported. -
setIncludeFilter
The filename of a filter specifying which bugs are reported. -
getExcludeFilter
The filename of a filter specifying bugs to exclude from being reported. -
setExcludeFilter
The filename of a filter specifying bugs to exclude from being reported. -
getExcludeBugsFilter
The filename of a filter specifying baseline bugs to exclude from being reported. -
setExcludeBugsFilter
The filename of a filter specifying baseline bugs to exclude from being reported. -
run
- Throws:
IOException
InterruptedException
-
extraArgs
Any additional arguments (not covered here more explicitly likeeffort
) 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.
- Since:
- 2.6
-
extraArgs
Any additional arguments (not covered here more explicitly likeeffort
) 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.
- Since:
- 2.6
-
jvmArgs
Any additional arguments to be passed along to FindBugs JVM process.Arguments can contain general JVM flags like
-Xdebug
and also FindBugs system properties like-Dfindbugs.loadPropertiesFrom=...
- Since:
- 4.3
-
jvmArgs
Any additional arguments to be passed along to FindBugs JVM process.Arguments can contain general JVM flags like
-Xdebug
and also FindBugs system properties like-Dfindbugs.loadPropertiesFrom=...
- Since:
- 4.3
-
getSource
Returns the source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist.- Overrides:
getSource
in classSourceTask
- Returns:
- The source.
-
getCandidateClassFiles
@SkipWhenEmpty @PathSensitive(RELATIVE) @InputFiles protected FileCollection getCandidateClassFiles()The classes to be analyzed. -
getClasses
The class directories to be analyzed. -
setClasses
The class directories to be analyzed. -
getClasspath
Compile class path for the classes to be analyzed. The classes on this class path are used during analysis but aren't analyzed themselves. -
setClasspath
Compile class path for the classes to be analyzed. The classes on this class path are used during analysis but aren't analyzed themselves. -
getFindbugsClasspath
Class path holding the FindBugs library. -
setFindbugsClasspath
Class path holding the FindBugs library. -
getPluginClasspath
Class path holding any additional FindBugs plugins. -
setPluginClasspath
Class path holding any additional FindBugs plugins. -
getIgnoreFailures
public boolean getIgnoreFailures()Whether to allow the build to continue if there are warnings.- Specified by:
getIgnoreFailures
in interfaceVerificationTask
- Returns:
- false, when the build should break on failure, true when the failures should be ignored.
-
setIgnoreFailures
public void setIgnoreFailures(boolean ignoreFailures) Whether to allow the build to continue if there are warnings.- Specified by:
setIgnoreFailures
in interfaceVerificationTask
- Parameters:
ignoreFailures
- false to break the build on failure, true to ignore the failures. The default is false.
-
getEffort
The analysis effort level. The value specified should be one ofmin
,default
, ormax
. Higher levels increase precision and find more bugs at the expense of running time and memory consumption. -
setEffort
The analysis effort level. The value specified should be one ofmin
,default
, ormax
. Higher levels increase precision and find more bugs at the expense of running time and memory consumption. -
getReportLevel
The priority threshold for reporting bugs. If set tolow
, all bugs are reported. If set tomedium
(the default), medium and high priority bugs are reported. If set tohigh
, only high priority bugs are reported. -
setReportLevel
The priority threshold for reporting bugs. If set tolow
, all bugs are reported. If set tomedium
(the default), medium and high priority bugs are reported. If set tohigh
, only high priority bugs are reported. -
getMaxHeapSize
The maximum heap size for the forked findbugs process (ex: '1g'). -
setMaxHeapSize
The maximum heap size for the forked findbugs process (ex: '1g'). -
getVisitors
The bug detectors which should be run. The bug detectors are specified by their class names, without any package qualification. By default, all detectors which are not disabled by default are run. -
setVisitors
The bug detectors which should be run. The bug detectors are specified by their class names, without any package qualification. By default, all detectors which are not disabled by default are run. -
getOmitVisitors
Similar tovisitors
except that it specifies bug detectors which should not be run. By default, no visitors are omitted. -
setOmitVisitors
Similar tovisitors
except that it specifies bug detectors which should not be run. By default, no visitors are omitted. -
getIncludeFilterConfig
A filter specifying which bugs are reported. Replaces theincludeFilter
property.- Since:
- 2.2
-
setIncludeFilterConfig
A filter specifying which bugs are reported. Replaces theincludeFilter
property.- Since:
- 2.2
-
getExcludeFilterConfig
A filter specifying bugs to exclude from being reported. Replaces theexcludeFilter
property.- Since:
- 2.2
-
setExcludeFilterConfig
A filter specifying bugs to exclude from being reported. Replaces theexcludeFilter
property.- Since:
- 2.2
-
getExcludeBugsFilterConfig
A filter specifying baseline bugs to exclude from being reported.- Since:
- 2.4
-
setExcludeBugsFilterConfig
A filter specifying baseline bugs to exclude from being reported.- Since:
- 2.4
-
getExtraArgs
Any additional arguments (not covered here more explicitly likeeffort
) 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.
- Since:
- 2.6
-
setExtraArgs
Any additional arguments (not covered here more explicitly likeeffort
) 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.
- Since:
- 2.6
-
getShowProgress
Indicates whether analysis progress should be rendered on standard output. Defaults to false.- Since:
- 4.2
-
setShowProgress
public void setShowProgress(boolean showProgress) Indicates whether analysis progress should be rendered on standard output.- Since:
- 4.2
-
getJvmArgs
Any additional arguments to be passed along to FindBugs JVM process.Arguments can contain general JVM flags like
-Xdebug
and also FindBugs system properties like-Dfindbugs.loadPropertiesFrom=...
- Since:
- 4.3
-
setJvmArgs
Any additional arguments to be passed along to FindBugs JVM process.Arguments can contain general JVM flags like
-Xdebug
and also FindBugs system properties like-Dfindbugs.loadPropertiesFrom=...
- Since:
- 4.3
-