build.xml
file.
The ckjm jar file should be in the classpath.
<taskdef name="ckjm" classname="gr.spinellis.ckjm.ant.CkjmTask"> <classpath> <pathelement location="path/to/ckjm1-2.jar"/> </classpath> </taskdef>Now you can make use of the ckjm task. The attributes of the ckjm task are the following:
<ckjm outputfile="ckjm.xml" format="xml" classdir="build/classes"> <include name="**/*.class" /> <exclude name="**/*Test.class" /> <extdirs path="lib" /> </ckjm>You can use an XSL stylesheet to generate an HTML report from the XML output file. Example:
<style in="ckjm.xml" style="path/to/ckjm.xsl" out="ckjm.html" />The distribution contains in the
xsl
directory
two sample XSL files.
Here is a complete example of a build.xml file.
<project name="myproject" default="ckjm"> <target name="compile"> <!-- your compile instructions --> </target> <target name="ckjm" depends="compile"> <taskdef name="ckjm" classname="gr.spinellis.ckjm.ant.CkjmTask"> <classpath> <pathelement location="path/to/ckjm1-2.jar"/> </classpath> </taskdef> <ckjm outputfile="ckjm.xml" format="xml" classdir="build/classes"> <include name="**/*.class" /> <exclude name="**/*Test.class" /> </ckjm> <style in="ckjm.xml" style="path/to/ckjm.xsl" out="ckjm.html" /> </target>If the analyzed files form part of a class hierarchy of other class files that are not part of the analysis, then the
extdirs
path-like structure
of the ckjm task must be set to point to the directory containing
the corresponding jar files.
This will internally set the java.ext.dirs property so that
ckjm can locate the jar files containing those classes.
Contents | « Previous Next (Web Links and Acknowledgements) » |