This task integrates CppNcss into an Apache Ant build process.
It generates an xml report to a file which in turn can be transformed to an html page with the XSLT task.
In order to use the task it must be defined with a Taskdef.
<taskdef name="cppncss" classname="cppncss.CppNcssTask">
<classpath>
<pathelement location="cppncss-1.0.2.jar"/>
<pathelement location="dom4j-1.6.1.jar"/>
</classpath>
</taskdef>
| Attribute | Description | Required |
| tofile | the name of the output file | Yes |
| prefix | the prefix to remove from paths | No |
| keepgoing | whether the parsing must keep going instead of stopping upon the first error, defaults to no | No |
| sorting | a list or ordered measurements to perform, defaults to "NCSS,CCN,function" | No |
| samples | the number of samples to keep, defaults to keep them all | No |
Use filesets to specify the source files to parse.
Use defines to suppress define symbols from input while parsing.
| Attribute | Description | Required |
| name | the symbol to replace | Yes |
| value | the value of the replacement, default to empty | No |
Use macros to suppress macro expressions from input while parsing.
| Attribute | Description | Required |
| name | the symbol to replace | Yes |
| value | the value of the replacement, default to empty | No |
<cppncss tofile="cppncss.xml"> <fileset dir="src"/> <define name="WINAPI"/> <macro name="BEGIN_COM_MAP"/> <macro name="END_COM_MAP"/> </cppncss>
analyzes all files found recursively under the src directory, with one define and two macro symbols to suppress.
<cppncss tofile="cppncss.xml" samples="30"> <fileset dir="src"/> </cppncss>
analyzes all files found recursively under the src directory, reporting only the 30 top measurements.
<cppncss tofile="cppncss.xml"> <fileset dir="src" measurements="function,CCN"/> </cppncss>
analyzes all files found recursively under the src directory, keeping only function and CCN measurements and sorting them in this order.