2.2. ANT usage

<emmajava> task is an implicit combination of <instr> and <report> tasks and most of its attributes and nested elements are the same as for those two tasks combined.

Parameters specified as attributes

AttributeDescriptionRequired
[stock ANT <java> task attributes]
[common EMMA task attributes]No
libclasspathA path-like structure containing EMMA core (emma.jar).Yes, unless EMMA is installed as the JRE extension
libclasspathrefSame as libclasspath, but given as a reference to a path defined elsewhere.Yes, unless EMMA is installed as the JRE extension
fullmetadataIndicates whether the entire classpath should be added to the coverage metadata (default: false).No
dumpsessiondataIndicates whether the session (metadata+coverage) data resulting from this coverage run should be dumped to a file. Useful for post-run coverage report generation (default: false).No
sessiondatafile, outfileIf dumpsessiondata='true', overrides the location to store session data (default: file coverage.es in the current directory). Ignored otherwise. No
mergeIndicates whether the session data should be merged into the destination sessiondatafile, if any (default: true). Any existing data is clobbered otherwise.No
filterAdds a coverage filter. See Section 6.2, “Coverage filters” for general description of EMMA coverage filters and Section 6.2.1, “filter syntax: ANT” specifically for ANT syntax. This attribute plays a role equivalent to the same attribute of <instr>.No
sourcepathA path-like structure that can be used to point the HTML report generator in <emmajava>/emmarun to the location of your Java source files. It is interpreted as a list of directories (separated by the OS-specific classpath separator or comma) containing .java source files. The local path names within each directory should reflect class package names. This attribute is equivalent to the same attribute of <report> task.No
sourcepathrefSame as sourcepath, but given as a reference to a path defined elsewhere.No
unitsEquivalent to the same attribute of <report>.No
depthEquivalent to the same attribute of <report>.No
columnsEquivalent to the same attribute of <report>.No
sortEquivalent to the same attribute of <report>.No
metricsEquivalent to the same attribute of <report>.No
encodingEquivalent to the same attribute of <report>.No

Parameters specified as nested elements

ElementDescriptionRequired
[stock ANT <java> task nested elements]
[common EMMA task nested elements]No
<filter>Adds a coverage filter. See Section 6.2, “Coverage filters” for general description of EMMA coverage filters and Section 6.2.1, “filter syntax: ANT” specifically for ANT syntax. This nested element plays a role equivalent to the same element of <instr>.No
<sourcepath>A path-like structure that can be used to point the HTML report generator in <emmajava>/emmarun to the location of your Java source files. This element is equivalent to the same nested element of <report> task.No
<txt>Equivalent to the same nested element of <report>.No
<html>Equivalent to the same nested element of <report>.No (<txt> implied by default)
<xml>Equivalent to the same nested element of <report>.No (<txt> implied by default)

<txt>, <html>, and <xml> nested elements. These nested elements create plain text, HTML, and XML coverage reports, respectively. If none is specified, the plain text report is implied (at most one configurator of any given report type can be nested inside a given <emmajava> call). Configuration of these elements is described in the equivalent section of <report> task reference page.

Examples