## Dependency-analyzer

### Description

This task analyzes dependencies between groups of classes and produces a report. Group of class is defined with include/exclude declaration. The report format can be a simple ASCII text printed on screen, or an xml files. This task is based on ASM 2.x.

Here is an exemple of xml report ( the dtd).

The task class is DependencyAnalyser.

### Parameters

Attribute | Description | Required
dir | the root directory of classes | No
output | the report file. If the file extension is xml, the report format is XML, otherwise simple indented text. | No (by default the report is on screen)
| showContent | indicates if the report must list groups content. | No (default is false)

### Parameters Specified as Nested Elements

#### group

The group nested element is a fileset. All includes files must be .class file. This nested element has a dir attribute for the root of the fileset. By default the root directory is the one specified at task level.

### Examples

This first example analyzes dependencies classes from the directory output/build. There is 3 groups (ejb, jdo and common). The xml report file is output/build/dependency.xml :

    <taskdef resource="ow.tasks" classpath="lib/ow_util_ant_tasks.jar">
    ...
    <dependency dir="output/build" showContent="true"
    	output="output/build/dependency.xml">
    	<group name="ejb">
    		<include name="**/EJB*.class"/>
    		<include name="**/ejb/*.class"/>
    		<include name="**/ejb/*/*.class"/>
    		<include name="javax/persistence/**/*.class"/>
    	</group>
    	<group name="jdo">
    		<include name="**/JDO*.class"/>
    		<include name="**/jdo/*.class"/>
    		<include name="**/jdo/*/*.class"/>
    		<include name="javax/jdo/**/*.class"/>
    	</group>
    	<group name="common">
    		<include name="**/*.class"/>
    		<exclude name="**/EJB*.class"/>
    		<exclude name="**/JDO*.class"/>
    		<exclude name="**/ejb/*.class"/>
    		<exclude name="**/ejb/*/*.class"/>
    		<exclude name="**/jdo/*.class"/>
    		<exclude name="**/jdo/*/*.class"/>
    	</group>
    </dependency>

Copyright © 2000-2005 France Telecom. All rights Reserved.