Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
BIN
+38.7 KB
contrib/fitnesse/ModuleDependencyFixture.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,7 @@ | ||
# FitNesse Module Dependency Fixture | ||
|
||
Bob Martin contributed the Module Dependency Fixture | ||
(`ModuleDependencyFixture.zip`) for FitNesse. | ||
|
||
For details on how to use it, see | ||
[Using the JDepend Fixture for FitNesse](http://www.butunclebob.com/ArticleS.UncleBob.JdependFixture). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
COMMAND=$0 | ||
JDEPEND_DIR=`dirname $COMMAND`/.. | ||
|
||
GRAPHVIZ_PATH=~/Applications/Graphviz/Graphviz.app/Contents/MacOS | ||
|
||
java -classpath $JDEPEND_DIR/lib/jdepend.jar jdepend.xmlui.JDepend -file jdepend.xml $JDEPEND_DIR/lib/jdepend.jar | ||
|
||
xsltproc jdepend2dot.xsl jdepend.xml > jdepend.dot | ||
|
||
$GRAPHVIZ_PATH/dot -Tpng jdepend.dot -o jdepend-report.png | ||
#$GRAPHVIZ_PATH/dot -Tsvg jdepend.dot -o jdepend-report.svg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,75 @@ | ||
<?xml version="1.0"?> | ||
|
||
<!-- | ||
Takes the XML output from JDepend and transforms it | ||
into the 'dot' language used by Graphviz | ||
(http://www.research.att.com/sw/tools/graphviz/) | ||
to generate a project dependency graph. | ||
The packages show up as rectangles with the package name | ||
and the number of classes. Arrows point to other packages | ||
the package depends on. The rectangle is colored blue, but | ||
it turns to darker shades of red the further the package is | ||
from the 'main line'. | ||
Contributed by David Bock. | ||
--> | ||
|
||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | ||
|
||
<xsl:output method="text"/> | ||
<xsl:template match="JDepend"> | ||
<Root-Element> | ||
digraph g { | ||
graph [ | ||
rankdir = "LR" | ||
]; | ||
node [ | ||
fontsize = "12" | ||
fontname = "Courier" | ||
shape = "ellipse" | ||
]; | ||
edge[]; | ||
<xsl:apply-templates select="Packages"/> | ||
} | ||
</Root-Element> | ||
</xsl:template> | ||
|
||
<xsl:template match="Packages"> | ||
<xsl:apply-templates select="Package" mode="node"/> | ||
</xsl:template> | ||
|
||
<xsl:template match="Package" mode="node"> | ||
<xsl:text>"</xsl:text><xsl:value-of select="@name"/> <xsl:text>" [ | ||
label="</xsl:text><xsl:value-of | ||
select="@name"/><xsl:text> | Total Classes: </xsl:text><xsl:value-of select="Stats/TotalClasses/."/> | ||
<xsl:text>" | ||
shape="record" | ||
color=".99 </xsl:text> | ||
<xsl:choose> | ||
<xsl:when test="Stats/D"> | ||
<xsl:value-of select="Stats/D/."/> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:text>0.0</xsl:text> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
<xsl:text> .9" | ||
style=filled | ||
]; | ||
</xsl:text> | ||
<xsl:apply-templates select="DependsUpon"/> | ||
</xsl:template> | ||
|
||
<xsl:template match="Package" mode="edge"> | ||
<xsl:text>"</xsl:text><xsl:value-of select="../../@name"/> <xsl:text>" -> "</xsl:text><xsl:value-of select="."/><xsl:text>" | ||
</xsl:text> | ||
</xsl:template> | ||
|
||
<xsl:template match="DependsUpon"> | ||
<xsl:apply-templates select="Package" mode="edge"/> | ||
</xsl:template> | ||
|
||
</xsl:stylesheet> |