Skip to content

Instantly share code, notes, and snippets.

@fredgrott
Created May 14, 2011 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fredgrott/972541 to your computer and use it in GitHub Desktop.
Save fredgrott/972541 to your computer and use it in GitHub Desktop.
jdepend-ant-task-android
Jdepend is the weird one that most get wrong and hence do not use when they should,
they key is getting the paths right:
<path id="jdepend.paths">
<fileset dir="build/classes">
<include name="**/*.class"/>
</fileset>
<fileset dir="${anttasklibs.dir}/jdepend" includes="jdepend-2.9.1.jar"/>
</path>
you still put the jdepend.jar in the ant/libs path..in your IDE its on your ant runtime preferences screen.
<target name="-jdepend">
<jdepend
fork="true"
outputfile="${docs.dir}/jdepend.xml"
format="xml"
classpathref="jdepend.paths">
<sourcespath>
<pathelement location="${source.absolute.dir}"/>
</sourcespath>
<classespath>
<pathelement location="${out.classes.absolute.dir}"/>
</classespath>
</jdepend>
<xslt basedir="${docs.dir}" destdir="${docs.dir}"
style="${jdepend.xsl.loc}">
<param name="project" expression="${ant.project.name}"/>
<param name="today" expression="${DSTAMP}"/>
<param name="company" expression="${company}"/>
<mapper type="glob" from="jdepend.xml" to="jdepend.html"/>
</xslt>
<xslt basedir="${docs.dir}"
destdir="${docs.dir}"
includes="jdepend.xml"
extension=".dot"
style="${jdepend.dot.loc}"/>
<!-- need to define a path to Graphiz/dot path -->
<apply executable="${graphviz.home}"
dest="${docs.dir}"
parallel="false">
<arg value="-Tpng"/>
<arg value="-o"/>
<targetfile/>
<srcfile/>
<fileset dir="${docs.dir}" includes="*.dot"/>
<mapper type="glob" from="*.dot" to="*.png"/>
</apply>
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment