next up previous contents index
Next: Metamata Audit Up: Metamata Metrics Previous: Parameters   Contents   Index

Nested elements

For specifying the source code to analyze, you can either use a path or fileset elements (though a single path element is preferred, see note below).

jvmarg

Additional parameters may be passed to the VM via nested <jvmarg> attributes. <jvmarg> allows all attributes described in Command line arguments.

classpath

Sets class path (also source path unless one explicitly set). Overrides METAPATH/CLASSPATH environment variables. The classpath element represents a PATH like structure.

sourcepath

Sets source path. Overrides the SOURCEPATH environment variable. The sourcepath element represents a PATH like structure.

path

Sets the list of directories to analyze the code for metrics.;It represents a PATH structure.

fileset

Sets a set of files to analyze for metrics.source It represents a FILESET structure.

Note: For the sake of readability, it is highly recommended to analyze for a single unique directory instead than using filesets or several directories. Otherwise there will be multiple metrics outputs without any way to know what metrics refers to what source. Chance are also that the XML handler that does some heuristic will be confused by the different outputs.

Example

  <mmetrics tofile="mmetrics.xml"
          metamatahome="c:/metamata"
          granularity="methods">
    <classpath>
      <pathelement location="c:/metamata/examples/metricsexamples"/>
    </classpath>
    <sourcepath>
      <pathelement location="c:/metamata/examples/metricsexamples"/>
    </sourcepath>
    <path>
      <pathelement location="c:/metamata/examples/metricsexamples"/>
    </path>
  </mmetrics>
This invokes Metamata Metrics installed in c:/metamata on the metrics example. (Note that here, classpath and sourcepath are not normally not needed) Generating a report As a convenience, there is an XSL file(mmetrics-frames.xsl) that allows you to generate a full framed HTML report of the metrics. You can find it in the etc directory of Ant. As it uses the Xalan redirect extensions, you will need Xalan and Xerces to run it. The stylesheet takes an output.dir parameter (otherwise it will be generated in the current directory), it can be run in Ant as follows:
<style in=java "${metrics.xml}" style="mmetrics-frames.xsl" out="null.tmp">
    <param name="output.dir" expression="${report.dir}"/>
</style>


next up previous contents index
Next: Metamata Audit Up: Metamata Metrics Previous: Parameters   Contents   Index
Andrew Marlow 2003-07-08