smor 2002/07/08 12:35:26
Modified: src/plugins/graph goalstoxml.dvsl plugin.jelly
plugin.properties
Log:
The goal "graph:goals" outputs a gif file of a graph showing the dependencies
between goals. This way one can have an overview of the workflow of Maven,
including his own goals / callbacks (not yet implemented), etc.
You can set several properties :
${maven.graph.rasterizer.executable} - defaults to "dot" (Graphviz)
${maven.graph.output.xml} - the destination of the goals XML file
${maven.graph.output.dot} - the destination of the goals dot file
${maven.graph.output.gif} - the destination of the goals gif file
Next to come: integration of callbacks, generation of a "goals.xml" xdoc
nb: the graph currently looks BAD ! This really needs some work ! :)
Revision Changes Path
1.2 +2 -4 jakarta-turbine-maven/src/plugins/graph/goalstoxml.dvsl
Index: goalstoxml.dvsl
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins/graph/goalstoxml.dvsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- goalstoxml.dvsl 8 Jul 2002 06:06:03 -0000 1.1
+++ goalstoxml.dvsl 8 Jul 2002 19:35:26 -0000 1.2
@@ -7,9 +7,7 @@
#end
#match("goal")
- n$attrib.id [label="$attrib.name"];
- #set( $i = $i + 1)
- #foreach( $prereq in $goal.prerequisites )
-
+ #foreach( $prereq in $node.selectNodes("prerequisite") )
+ "$prereq.attrib("name")" -> "$attrib.name"
#end
#end
1.2 +40 -6 jakarta-turbine-maven/src/plugins/graph/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins/graph/plugin.jelly,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- plugin.jelly 8 Jul 2002 06:06:03 -0000 1.1
+++ plugin.jelly 8 Jul 2002 19:35:26 -0000 1.2
@@ -1,14 +1,34 @@
-<project default="graph"
xmlns:maven="jelly:org.apache.maven.jelly.tags.project.MavenTagLibrary">
+<project default="graph"
+ xmlns:maven="jelly:org.apache.maven.jelly.tags.project.MavenTagLibrary">
+
+ <!-- ===================================================================== -->
+ <!-- G R A P H P R O J E C T D E P E N D E N C I E S -->
+ <!-- ===================================================================== -->
+ <!-- Get the dependencies from your POM, and output a tree of all -->
+ <!-- inherited dependencies. (to be implemented) -->
+ <!-- ===================================================================== -->
<goal name="graph:project-dependencies">
</goal>
- <goal name="graph:goals">
+
+ <!-- ===================================================================== -->
+ <!-- G R A P H G O A L S -->
+ <!-- ===================================================================== -->
+ <!-- Output the Werkz Project and Goals to an XML file, then make a .dot -->
+ <!-- file, which can then be generated by Graphviz. Other implementations -->
+ <!-- should come soon (commons-graph, for instance). -->
+ <!-- ===================================================================== -->
+
+ <goal name="graph:goals"
+ description="Get a .gif graph of current goals and their dependencies">
+
<mkdir dir="${maven.build.dir}/graph"/>
- <maven:goalsToXML file="${maven.build.dir}/graph/goals.xml"
project="${org.apache.commons.jelly.werkz.Project}"/>
+ <maven:goalsToXML file="${maven.build.dir}/graph/goals.xml"
+ project="${org.apache.commons.jelly.werkz.Project}"/>
<taskdef
name="dvsl"
@@ -27,10 +47,24 @@
<!-- Need to add the maven jar to load the toolbox -->
</dvsl>
- <exec executable="${maven.graph.viewer.executable}">
- <arg value="${maven.build.dir}/graph/goals.dot"/>
+ <exec executable="${maven.graph.rasterizer.executable}">
+ <arg value="-T${maven.graph.output.image.format}"/>
+ <arg value="${maven.graph.output.dot}"/>
+ <arg value="-o"/>
+ <arg value="${maven.graph.output.image.file}"/>
</exec>
</goal>
- <goal name="graph" prereqs="graph:project-dependencies"/>
+
+
+ <!-- ===================================================================== -->
+ <!-- D E F A U L T G R A P H G O A L -->
+ <!-- ===================================================================== -->
+ <!-- Graph the goals to a gif -->
+ <!-- ===================================================================== -->
+
+ <goal name="graph"
+ description="Get a .gif graph of current goals and their dependencies"
+ prereqs="graph:goals"/>
+
</project>
1.2 +5 -1 jakarta-turbine-maven/src/plugins/graph/plugin.properties
Index: plugin.properties
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins/graph/plugin.properties,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- plugin.properties 8 Jul 2002 06:06:03 -0000 1.1
+++ plugin.properties 8 Jul 2002 19:35:26 -0000 1.2
@@ -1,2 +1,6 @@
maven.graph.viewer.executable = dotty
-maven.graph.viewer.commandline = ${maven.build.dir}/graph/goals.dot
+maven.graph.rasterizer.executable = dot
+maven.graph.output.xml = ${maven.build.dir}/graph/goals.xml
+maven.graph.output.dot = ${maven.build.dir}/graph/goals.dot
+maven.graph.output.image.format = gif
+maven.graph.output.image.file =
${maven.build.dir}/graph/goals.${maven.graph.output.image.format}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>