CQL Task

Description

This task provides REFLECTK's CQL functionality. It takes one or more instruction books and executes each rule referred there. See REFLECTK homepage for more information.

Parameters

Attribute Description Required
instbook The instruction book to load. The instruction book defines what rules to evaluate. You can pass in multiple instructionbooks seperated by whitespaces
Yes if nested instbook is unset
failOn
level the task should fail.
No; defaults to "error".
haltOnError Break the build if there where violating rules.
No; defaults to true.
failImmediately If true the Task will stop immediately otherwise it will continue and fail after evaluating the remaining rules.
No; defaults to true.
verbose Verbose output.  No; defaults to false.
outputstream stream the output should be written to, e.g "sys:out" or "file:output.txt".
No; defaults to false.
maxThreads Number of threads to use for evaluating the rules
No; defaults to number of CPUs.
violationpattern Pattern to use when a rule is violating.
No; defaults to "optional; default: ${ruleid}: ${title}${br}${desc}${br}[${prio}] ${hint}${br}${result}".
compliancepattern Pattern to use when a rule is compliance. No; defaults to "optional; default: ${ruleid}: ${title}".

Parameters specified as nested elements

searchclasspath

A path of classespathes and/or jars that should be checked

resolveclasspath

A path of classespathes and/or jars that are needed because classes in the searchclasspath depend on them

instbookRef

A path of instbooks. Can be used in conjunction with "instbook" or standalone

variable

Key/value pairs that should be passed to the rules. You can use placeholders in the CQLs like "where name($var)" and pass in the value for it

Examples

Check all JARs found in lib against the rules refered in example.instbook using 4 threads.
<path id="myPath">
<fileset dir="lib">
<include name="*.jar" />
</fileset>
</path>

<cql maxThreads="4" verbose="true" haltonerror="true" instbook="example.instbook">
<resolveclasspath refid="myPath" />
<searchclasspath refid="myPath" />
</cql>

Check all JARs found in lib against the rules refered in the instruction books found in path/to/instbooks.
<path id="myPath">
<fileset dir="lib">
<include name="*.jar" />
</fileset>
</path>

<path id="instbookPath">
<fileset dir="path/to/instbooks"><include name="*.instbook" /></fileset>
</path>

<cql>
<resolveclasspath refid="myPath" />
<searchclasspath refid="myPath" />
<instbook refid="instbookPath"/>
</cql>