Running the Doclet from Ant
To run the UMLGraph doclet from ant, use a rule,
like the following.
<target name="uml" depends="prepare">
<property name="uml.dir" value="${basedir}/uml"/>
<property name="src.uml.dir" value="${src.dir}/uml"/>
<mkdir dir="${uml.dir}"/>
<path id="uml.source.path">
<pathelement path="${src.uml.dir}/"/>
<pathelement path="${src.java.dir}"/>
</path>
<javadoc sourcepathref="uml.source.path" packagenames="*" package="true">
<doclet name="org.umlgraph.doclet.UmlGraph" path="${basedir}/lib/UmlGraph.jar">
<param name="-d" value="${uml.dir}"/>
</doclet>
</javadoc>
<apply executable="dot" dest="${uml.dir}" parallel="false">
<arg value="-Tpng"/>
<arg value="-o"/>
<targetfile/>
<srcfile/>
<fileset dir="${uml.dir}" includes="*.dot"/>
<mapper type="glob" from="*.dot" to="*.png"/>
</apply>
</target>
Notes
- When you pass the
packagenames
option to
javadoc, the default (unnamed) package (and the
UMLOptions
class
located in it) is ignored.
In such cases you should include the UMLOptions
class
within a named package.
- The above invocation will generated a single class
diagram. If multiple view generation is required you should add
the
views
option.