This is a task that can be used to check properties source files against properties files or classes in a directory or jar files.
See the RbChecker documention page.
See also the common attributes page.
Attribute | Description | Required |
---|---|---|
filechecker | Classname of the file checker to be used by this task. See the extending the file checker documention page. | No. |
classpath | The classpath to use when looking up classes or properties resourcebundles. Defaults to the current classpath. | No |
classpathref | The classpath to use when looking up classes or properties resourcebundles, given as a reference to a path defined elsewhere. | No |
THE CLASSPATH OPTION IS NOT CURRENTLY IMPLEMENTED
Workaround: include this classpath in the classpath of the taskdef
when declaring the rbutils jar.
Example
<taskdef resource="org/ktc/rbutils/rbutilsTasks.properties"> <classpath> <pathelement location="/path/to/rbutils-all-0.13.jar"/> <pathelement location="/path/to/your/rb"/> </classpath> </taskdef>
See the common nested elements page.
This task supports <classpath>. This is needed in order the task found target class or properties files for the check, if they are not in the bootstrap classpath.
Run RbChecker on all properties files of the root directory (properties extension), display errors and fail on errors.
<rbchecker root="myproject/src"/>
Run RbChecker on all properties files of the root directory (myrb extension), display errors on console, create xml audit file, and fail on errors and set a project property.
<rbchecker root="myproject/src" extension="myrb" failureProperty="rbcheckerProperty"> <logger type="plain"/> <logger type="xml" outputfile="rbchecker_report.xml"/> </rbchecker>
Run RbChecker on files found in the filset, display errors on console, create xml
audit file, maximum errors number tolerated is 5 and fail on errors.
Remember that all files in the fileset must be in the root directory in order
package name resolution works. This is why we use an Ant property here.
<property name="root.dir" location="myproject/src"> <rbchecker root="${root.dir}" maxErrors="5"> <logger type="plain"/> <logger type="xml" outputfile="rbchecker_report.xml"/> <fileset dir="${root.dir}"> <include name="**/*.properties"/> </fileset> </rbchecker>
Generate a html report after RbChecker processing.
<xslt in="rbchecker_report.xml" out="rbchecker_report.html" style="rbchecker-errors.xsl"/>