Package org.apache.rat.anttasks
Class Report
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.rat.anttasks.BaseAntTask
org.apache.rat.anttasks.Report
- All Implemented Interfaces:
Cloneable
A basic Ant task that generates a report on all files specified by the nested
resource collection(s).
IHeaderMatcher(s) can be specified as nested elements as well.
The attribute format
defines the output format and can take the
values
- xml - RAT's native XML output.
- styled - transforms the XML output using the given stylesheet. The stylesheet attribute must be set as well if this attribute is used.
- plain - plain text using RAT's built-in stylesheet. This is the default.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Deprecated.use <editCopyright> amd <editOverwrite> instead.static class
Deprecated.use listLicenses or listFamilies attributes.Nested classes/interfaces inherited from class org.apache.rat.anttasks.BaseAntTask
BaseAntTask.Cntr, BaseAntTask.Config, BaseAntTask.CounterMax, BaseAntTask.CounterMin, BaseAntTask.Exclude, BaseAntTask.Expr, BaseAntTask.Filename, BaseAntTask.Include, BaseAntTask.InputExclude, BaseAntTask.InputExcludeParsedScm, BaseAntTask.InputInclude, BaseAntTask.LicenseFamiliesApproved, BaseAntTask.LicenseFamiliesDenied, BaseAntTask.Licenses, BaseAntTask.LicensesApproved, BaseAntTask.LicensesDenied, BaseAntTask.Lst, BaseAntTask.Std, BaseAntTask.TxtValue
-
Field Summary
Fields inherited from class org.apache.rat.anttasks.BaseAntTask
args
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(org.apache.tools.ant.types.ResourceCollection rc) Adds resources that will be checked.void
addAddApprovedLicense
(String familyCategory) Deprecated.use licensesFamiliesApproved child elementvoid
Deprecated.Create a custom configuration file and use the config option.void
addLicense
(License license) Deprecated.Create a custom configuration file and use the config option.void
addRemoveApprovedLicense
(String familyCategory) Deprecated.use licensesFamiliesDenied child elementvoid
addRemoveApprovedLicense
(String[] familyCategory) Deprecated.use licenseFamilyDenied elementvoid
addStylesheet
(org.apache.tools.ant.types.Resource styleSheet) Deprecated.void
addStyleSheet
(org.apache.tools.ant.types.Resource styleSheet) Deprecated.void
execute()
Generates the report.static Log.Level
fromProjectLevel
(int level) Converts to RAT log level from Ant Project log level.Creates the ReportConfiguration from the ant options.Reads values for the Arg.void
void
protected void
Removes the values for the arg.void
setAddApprovedLicense
(String familyCategory) Deprecated.use licensesApproved child element.void
setAddDefaultDefinitions
(File fileName) Deprecated.Use Config child elementvoid
Deprecated.use editLicense and editOverwrite attributesvoid
setCopyrightMessage
(String copyrightMessage) Deprecated.use copyright attributevoid
Deprecated.void
setInputFileFilter
(org.apache.commons.io.filefilter.IOFileFilter inputFileFilter) Deprecated.void
setLicenses
(File fileName) Deprecated.create a configuration file and use the <config> child element.void
setRemoveApprovedLicense
(String familyCategory) Deprecated.use licensesFamiliesDenied child elementvoid
setRemoveApprovedLicense
(String[] familyCategory) Deprecated.use licenseFamiliesDenied elementvoid
setReportFile
(File reportFile) Deprecated.use outputFile elementvoid
setStyleReport
(boolean styleReport) Deprecated.useBaseAntTask.setOutputStyle(String)
and pass "xml" or "plain-rat".void
setUseDefaultLicenses
(boolean useDefaultLicenses) Deprecated.use noDefaultLicenses attributeprotected ReportConfiguration
validates the task's configuration.Methods inherited from class org.apache.rat.anttasks.BaseAntTask
addArg, addArg, args, createConfig, createCounterMax, createCounterMin, createExclude, createInclude, createInputExclude, createInputExcludeParsedScm, createInputInclude, createLicenseFamiliesApproved, createLicenseFamiliesDenied, createLicenses, createLicensesApproved, createLicensesDenied, createName, getArg, removeArg, setAddLicense, setArg, setConfigurationNoDefaults, setCopyright, setDryRun, setEditCopyright, setEditLicense, setEditOverwrite, setExcludeFile, setForce, setHelpLicenses, setIncludesFile, setInputExcludeSize, setListFamilies, setListLicenses, setNoDefaultLicenses, setOut, setOutputArchive, setOutputFamilies, setOutputFile, setOutputLicenses, setOutputStandard, setOutputStyle, setScanHiddenDirectories, setStylesheet, setXml, unsupportedArgs
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Constructor Details
-
Report
public Report()Constructor.
-
-
Method Details
-
add
public void add(org.apache.tools.ant.types.ResourceCollection rc) Adds resources that will be checked.- Parameters:
rc
- resource to check.
-
setInputFileFilter
@Deprecated public void setInputFileFilter(org.apache.commons.io.filefilter.IOFileFilter inputFileFilter) Deprecated.Adds an input file filter.- Parameters:
inputFileFilter
- The input file filter to add.
-
setReportFile
Deprecated.use outputFile elementSets the report file.- Parameters:
reportFile
- the report file.
-
addLicense
Deprecated.Create a custom configuration file and use the config option.Adds an inline License definition to the system.- Parameters:
license
- the license to add.
-
addFamily
Deprecated.Create a custom configuration file and use the config option.Add an inline license family definition to the system.- Parameters:
family
- the license family to add.
-
addStylesheet
Deprecated.Adds a style sheet to the system.- Parameters:
styleSheet
- The style sheet to use for formatting.
-
addStyleSheet
Deprecated.Adds a given style sheet to the report.- Parameters:
styleSheet
- style sheet to use in this report.
-
setStyleReport
Deprecated.useBaseAntTask.setOutputStyle(String)
and pass "xml" or "plain-rat".Styles the report or deliver xml document.- Parameters:
styleReport
- true to use the plain-rat style
-
setFormat
Deprecated.Determines if the output should be styled.- Parameters:
style
- the name of the style sheet ot use, or "styled" for plain-rat style
-
setLicenses
Deprecated.create a configuration file and use the <config> child element.Adds as a file containing the definitions of licenses to the system.- Parameters:
fileName
- the file to add.
-
setUseDefaultLicenses
Deprecated.use noDefaultLicenses attributeSpecifies whether to add the default list of license matchers.- Parameters:
useDefaultLicenses
- iftrue
use the default licenses.
-
setAddApprovedLicense
Deprecated.use licensesApproved child element.Adds a family category to the list of approved licenses.- Parameters:
familyCategory
- the category to add.
-
addAddApprovedLicense
Deprecated.use licensesFamiliesApproved child elementAdds a family category to the list of approved licenses.- Parameters:
familyCategory
- the category to add
-
setRemoveApprovedLicense
Deprecated.use licensesFamiliesDenied child elementRemoves a family category to the list of approved licenses.- Parameters:
familyCategory
- the category to add.
-
addRemoveApprovedLicense
Deprecated.use licensesFamiliesDenied child elementRemoves a family category to the list of approved licenses.- Parameters:
familyCategory
- the category to add.
-
setRemoveApprovedLicense
Deprecated.use licenseFamiliesDenied elementRemoves a family category to the list of approved licenses.- Parameters:
familyCategory
- the category to remove
-
addRemoveApprovedLicense
Deprecated.use licenseFamilyDenied elementRemoves a family category to the list of approved licenses.- Parameters:
familyCategory
- the category to remove.
-
setCopyrightMessage
Deprecated.use copyright attributeSets the copyright message- Parameters:
copyrightMessage
- the copyright message
-
setAddLicenseHeaders
Deprecated.use editLicense and editOverwrite attributesDetermines if license headers should be added.- Parameters:
setting
- the setting.
-
setAddDefaultDefinitions
Deprecated.Use Config child elementAdds definition information- Parameters:
fileName
- the file to add
-
getValues
Reads values for the Arg.- Parameters:
arg
- The Arg to get the values for.- Returns:
- The list of values or an empty list.
-
removeKey
Removes the values for the arg.- Parameters:
arg
- the arg to remove the values for.
-
getConfiguration
Creates the ReportConfiguration from the ant options.- Returns:
- the ReportConfiguration.
-
execute
public void execute()Generates the report.- Overrides:
execute
in classorg.apache.tools.ant.Task
-
validate
validates the task's configuration. -
log
- Overrides:
log
in classorg.apache.tools.ant.Task
-
log
- Overrides:
log
in classorg.apache.tools.ant.Task
-
fromProjectLevel
Converts to RAT log level from Ant Project log level.- Parameters:
level
- the Ant Project log level to convert.- Returns:
- the equivalent RAT log level.
-