Skip to content

Commit

Permalink
Add contributed works
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkware committed Mar 6, 2020
1 parent 3bc9bd2 commit 5a55225
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 0 deletions.
Binary file added contrib/fitnesse/ModuleDependencyFixture.zip
Binary file not shown.
7 changes: 7 additions & 0 deletions contrib/fitnesse/README.md
Original file line number Diff line number Diff line change
@@ -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).
13 changes: 13 additions & 0 deletions contrib/jdepend2dot.sh
Original file line number Diff line number Diff line change
@@ -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
75 changes: 75 additions & 0 deletions contrib/jdepend2dot.xsl
Original file line number Diff line number Diff line change
@@ -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>" -&gt; "</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>

0 comments on commit 5a55225

Please sign in to comment.