|
1.1 AnalyserClassycle's Analyser can be used as a command-line tool and as an Ant Task.1.1.1 Command Line ToolAnalyser is called from the command line as follows:java -jar classycle.jar [-raw] [-cycles|-strong] [-packagesOnly]\ [-mergeInnerClasses]\ [-includingClasses=<pattern1>[,<pattern2>,...]]\ [-excludingClasses=<pattern1>[,<pattern2>,...]] \ [-reflectionPattern=[<pattern1>,<pattern2>,...]] \ [-xmlFile=<file>] [-csvFile=<file>] \ [-title=<title>] \ <class files, zip/jar/war/ear files, or folders>The argument is a list of sources for class files to be analyzed:
The options have the following meaning:
The XML report refers to the XSL transformation reportXMLtoHTML.xsl. Modern Web browser are able to render the XML report with the help of this XSL transformation. Otherwise an XSLT processor (like xalan) is needed to create an HTML document from the XML report. In any case the folder images is needed in the same directory as the report (and the XSL file). 1.1.2 Ant TaskI wrote an Ant Task based on the Ant Task written by Boris Gruschko (see Patch 977610: Ant task for classycle). Here is a simple build file showing its usage:<?xml version="1.0"?> <project name="Classycle Ant Task Example" default="report" basedir="."> <taskdef name="classycleReport" classname="classycle.ant.ReportTask"/> <target name="report"> <classycleReport reportFile="classycle.xml"> <fileset dir="."> <include name="classycle.jar"/> </fileset> </classycleReport> </target> </project>The source of class files can be specified by filesets and zipfilesets. For the attributes and their meaning see the API documentation of ReportTask. Running this example build file on the console yields Buildfile: exampleBuild.xml report: [classycleReport] ============= Classycle V1.0 ============= [classycleReport] ========== by Franz-Josef Elmer ========== [classycleReport] read class files and create class graph ... done after ... [classycleReport] condense class graph ... done after ... [classycleReport] calculate class layer indices ... done after ... [classycleReport] create package graph ... done after ... [classycleReport] condense package graph ... done after ... [classycleReport] calculate package layer indices ... done after ... BUILD SUCCESSFUL Total time: 1 secondand a file classycle.xml with the XML report of the analysis of classycle.jar. To run with Ant 1.6 type: ant -lib classycle.jar -f <build file> <target>For earlier Ant versions the option -lib does not work and you must copy classycle.jar into the folder lib of the home directory of your Ant installation. The Ant task has been tested with Ant 1.5.3 and 1.6.1. |
(C) 2003-2008 Franz-Josef Elmer. All rights reserved. Last modified: 9/9/2012 |