kaz 02/05/03 18:50:11
Modified: . build-bootstrap.xml
src/templates/build build-docs.xml
Added: src/templates/xdocs Control.vm dependencies.xml
developer-list.xml index.xml mail-lists.xml
Removed: src/dvsl/xdocs dependencies.dvsl developer-list.dvsl
index.dvsl mail-lists.dvsl
Log:
Maven generates (among other things): index.xml, dependencies.xml,
developer-list.xml, and mail-lists.xml using DVSL which takes the
project descriptor as input (project.xml) and transforms it
appropriately.
I'm changing the generation of this content to use Texen instead because
I need to generate other content besides content that is based on the
project descriptor. Since we have a Texen task that already has the POM
loaded in the context, it was trivial to move the above doc generation
to use Texen so all of the document generation can be done in a uniform
manner.
Also, by using Texen we also remove the dependency that project.xml has
to exist in the filesystem. A nice side-effect.
Revision Changes Path
1.79 +4 -0 jakarta-turbine-maven/build-bootstrap.xml
Index: build-bootstrap.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/build-bootstrap.xml,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -r1.78 -r1.79
--- build-bootstrap.xml 25 Apr 2002 15:51:27 -0000 1.78
+++ build-bootstrap.xml 4 May 2002 01:50:11 -0000 1.79
@@ -299,6 +299,10 @@
<fileset dir="src/templates/reactor"/>
</copy>
+ <copy todir="${maven.home}/templates/xdocs">
+ <fileset dir="src/templates/xdocs"/>
+ </copy>
+
<copy todir="${maven.home}/images">
<fileset dir="src/images"/>
</copy>
1.62 +9 -66 jakarta-turbine-maven/src/templates/build/build-docs.xml
Index: build-docs.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/templates/build/build-docs.xml,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- build-docs.xml 1 May 2002 19:51:05 -0000 1.61
+++ build-docs.xml 4 May 2002 01:50:11 -0000 1.62
@@ -139,79 +139,22 @@
<target
name="generate-xdocs"
- depends="local-init, docs:index, docs:mail-lists, docs:developer-list,
docs:dependencies"
- description="o Generates xdocs for site based on project descriptor" />
+ depends="local-init"
+ description="o Generates xdocs for site based on project descriptor" >
- <target
- name="docs:index"
- description="o Generates front page">
-
- <taskdef name="dvsl" classname="org.apache.tools.dvsl.DVSLTask">
+ <taskdef name="create-xdocs" classname="org.apache.maven.BaseProjectTask">
<classpath>
<path refid="maven-classpath"/>
</classpath>
</taskdef>
- <dvsl
- basedir="."
- style="${maven.home}/stylesheets/index.dvsl"
- in="project.xml"
- out="${gen.docs}/index.xml"
- />
- </target>
-
- <target
- name="docs:mail-lists"
- description="o Generate html project documentation xdoc sources">
-
- <taskdef name="dvsl" classname="org.apache.tools.dvsl.DVSLTask">
- <classpath>
- <path refid="maven-classpath"/>
- </classpath>
- </taskdef>
-
- <dvsl
- basedir="."
- style="${maven.home}/stylesheets/mail-lists.dvsl"
- in="project.xml"
- out="${gen.docs}/mail-lists.xml"
- />
- </target>
-
- <target
- name="docs:developer-list"
- description="o Generate html project documentation xdoc sources">
-
- <taskdef name="dvsl" classname="org.apache.tools.dvsl.DVSLTask">
- <classpath>
- <path refid="maven-classpath"/>
- </classpath>
- </taskdef>
-
- <dvsl
- basedir="."
- style="${maven.home}/stylesheets/developer-list.dvsl"
- in="project.xml"
- out="${gen.docs}/developer-list.xml"
- />
- </target>
-
- <target
- name="docs:dependencies"
- description="o Generate html project documentation xdoc sources">
-
- <taskdef name="dvsl" classname="org.apache.tools.dvsl.DVSLTask">
- <classpath>
- <path refid="maven-classpath"/>
- </classpath>
- </taskdef>
+ <create-xdocs
+ controlTemplate="Control.vm"
+ outputDirectory="${gen.docs}"
+ templatePath="${maven.home}/templates/xdocs"
+ outputFile="xdocs.report"
+ projectDescriptor="project.xml" />
- <dvsl
- basedir="."
- style="${maven.home}/stylesheets/dependencies.dvsl"
- in="project.xml"
- out="${gen.docs}/dependencies.xml"
- />
</target>
<!-- ================================================================== -->
1.1 jakarta-turbine-maven/src/templates/xdocs/Control.vm
Index: Control.vm
===================================================================
## ------------------------------------------------------------------
## Generate the reactor
## ------------------------------------------------------------------
$buildElements.add("index.xml")
$buildElements.add("mail-lists.xml")
$buildElements.add("developer-list.xml")
$buildElements.add("dependencies.xml")
#foreach ($buildElement in $buildElements)
Generating $buildElement
Successful: $generator.parse($buildElement, $buildElement)
#end
1.1 jakarta-turbine-maven/src/templates/xdocs/dependencies.xml
Index: dependencies.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<title>Dependencies</title>
</properties>
<body>
<section name="Dependencies">
#if ($project.dependencies.size() == 0)
<p>
There are no dependencies for this project. It is a standalone
application that does not depend on any other project.
</p>
#else
<p>
The following is a list of dependencies for this project. These
dependencies are required to compile and run the application:
</p>
<table>
<tr>
<th>Name</th>
<th>Type</th>
<th>Version</th>
<th>JAR</th>
</tr>
#foreach ($dep in $project.dependencies)
<tr>
<td>
#if ($dep.url && $dep.url.length() != 0)
<a href="$dep.url">$!dep.name</a>
#else
$!dep.name
#end
</td>
<td>$!dep.type</td>
<td>$!dep.version</td>
<td>$!dep.jar</td>
</tr>
#end
</table>
#end
</section>
</body>
</document>
1.1 jakarta-turbine-maven/src/templates/xdocs/developer-list.xml
Index: developer-list.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<title>Developers</title>
</properties>
<body>
<section name="Developers">
#if ($project.developers.size() == 0)
<p>
There are no developers working on this project. Please check
back at a later date.
</p>
#else
<p>
The following is a list of developers that have contributed to
the project in one way or another. Their contributions range
from source code to documentation to bug fixes. All contributions
to the project are greatly appreciated.
</p>
<table>
<tr>
<th>Name</th>
<th>Email</th>
<th>Organization</th>
</tr>
#foreach ($developer in $project.developers)
<tr>
<td>$!developer.name</td>
<td><a href="mailto:$!developer.email">$!developer.email</a></td>
<td>$!developer.organization</td>
</tr>
#end
</table>
#end
</section>
</body>
</document>
1.1 jakarta-turbine-maven/src/templates/xdocs/index.xml
Index: index.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<title>$!project.name</title>
</properties>
<body>
<section name="$!project.name">
<p>
$!project.description
</p>
</section>
</body>
</document>
1.1 jakarta-turbine-maven/src/templates/xdocs/mail-lists.xml
Index: mail-lists.xml
===================================================================
<?xml version="1.0"?>
#macro (displayLink $label $link)
<td>
#if ($link && $link.length() != 0)
#if ($link.startsWith("http"))
<a href="$link">$label</a>
#else
<a href="mailto:$link">$label</a>
#end
#else
Not Available
#end
</td>
#end
<document>
<properties>
<title>Mailing Lists</title>
</properties>
<body>
<section name="Mailing Lists">
#if ($project.mailingLists.size() == 0)
<p>
There are no mailing lists established for this project. Please
check back at a later date.
</p>
#else
<p>
These are the mailing lists that have been established for this
project. For each list, there is a subscribe, unsubscribe, and an
archive link.
</p>
<table>
<tr>
<th>List Name</th>
<th>Subscribe</th>
<th>Unsubscribe</th>
<th>Archive</th>
</tr>
#foreach ($list in $project.mailingLists)
<tr>
<td>$list.name</td>
#displayLink("Subscribe" $list.subscribe)
#displayLink("Unsubscribe" $list.unsubscribe)
#displayLink("Archive" $list.archive)
</tr>
#end
</table>
#end
</section>
</body>
</document>