Author: jjensen Date: Sat Apr 21 08:24:44 2007 New Revision: 531048 URL: http://svn.apache.org/viewvc?view=rev&rev=531048 Log: Add feature to allow specifying doclet parameters. MPJAVADOC-80
Modified: maven/maven-1/plugins/trunk/javadoc/plugin.jelly maven/maven-1/plugins/trunk/javadoc/xdocs/changes.xml maven/maven-1/plugins/trunk/javadoc/xdocs/faq.fml maven/maven-1/plugins/trunk/javadoc/xdocs/properties.xml Modified: maven/maven-1/plugins/trunk/javadoc/plugin.jelly URL: http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/javadoc/plugin.jelly?view=diff&rev=531048&r1=531047&r2=531048 ============================================================================== --- maven/maven-1/plugins/trunk/javadoc/plugin.jelly (original) +++ maven/maven-1/plugins/trunk/javadoc/plugin.jelly Sat Apr 21 08:24:44 2007 @@ -398,10 +398,54 @@ <!-- allow custom doclets --> <!-- ========================== --> <j:if test="${context.getVariable('maven.javadoc.doclet') != null}"> - <ant:setProperty name="doclet" value="${maven.javadoc.doclet}" /> - </j:if> - <j:if test="${context.getVariable('maven.javadoc.docletpath') != null}"> - <ant:setProperty name="docletpath" value="${maven.javadoc.docletpath}" /> + <j:if test="${maven.javadoc.debug}"> + <ant:echo> +=============================================================================== +Processing custom doclet settings - BEGIN +------------------------------------------------------------------------------- + </ant:echo> + </j:if> + + <doclet name="${maven.javadoc.doclet}" path="${maven.javadoc.docletpath}"> + <j:if test="${!empty(maven.javadoc.doclet.param.list)}"> + <j:if test="${maven.javadoc.debug}"> + <ant:echo>Using doclet param list=${maven.javadoc.doclet.param.list}</ant:echo> + </j:if> + + <u:tokenize var="items" delim="${maven.javadoc.doclet.param.list.delim}"> + ${maven.javadoc.doclet.param.list} + </u:tokenize> + + <j:forEach var="item" items="${items}"> + <j:set var="param.prop.name" value="${item}.name"/> + <j:set var="param.prop.value" value="${item}.value"/> + + <!-- get value of variable held in the 'prop' variable --> + <j:set var="param.name" value="${context.getVariable(param.prop.name)}"/> + <j:set var="param.value" value="${context.getVariable(param.prop.value)}"/> + + <j:if test="${maven.javadoc.debug}"> + <ant:echo>For '${item}', adding param name='${param.name}' value='${param.value}'</ant:echo> + </j:if> + <j:if test="${empty(param.name)}"> + <ant:echo>ERROR: Did not find '${param.prop.name}' in properties!</ant:echo> + </j:if> + <j:if test="${empty(param.value)}"> + <ant:echo>WARNING: Did not find '${param.prop.value}' in properties! (this may be intended if the param does not have a value)</ant:echo> + </j:if> + <param name="${param.name}" value="${param.value}"/> + </j:forEach> + + </j:if> + </doclet> + + <j:if test="${maven.javadoc.debug}"> + <ant:echo> +------------------------------------------------------------------------------- +Processing custom doclet settings - END +=============================================================================== + </ant:echo> + </j:if> </j:if> <!-- ========================== --> Modified: maven/maven-1/plugins/trunk/javadoc/xdocs/changes.xml URL: http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/javadoc/xdocs/changes.xml?view=diff&rev=531048&r1=531047&r2=531048 ============================================================================== --- maven/maven-1/plugins/trunk/javadoc/xdocs/changes.xml (original) +++ maven/maven-1/plugins/trunk/javadoc/xdocs/changes.xml Sat Apr 21 08:24:44 2007 @@ -27,6 +27,7 @@ <body> <release version="1.8.1-SNAPSHOT" date="In SVN"> <action dev="aheritier" type="fix">Do not add a directory of sources which doesn't exist.</action> + <action dev="jjensen" type="add" issue="MPJAVADOC-80">Add specifying params with alternate doclets.</action> </release> <release version="1.8" date="2006-01-15"> <action dev="ltheussl" type="fix" issue="MPJAVADOC-52">Cannot set -sourcepath to add paths for inherited javadocs.</action> Modified: maven/maven-1/plugins/trunk/javadoc/xdocs/faq.fml URL: http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/javadoc/xdocs/faq.fml?view=diff&rev=531048&r1=531047&r2=531048 ============================================================================== --- maven/maven-1/plugins/trunk/javadoc/xdocs/faq.fml (original) +++ maven/maven-1/plugins/trunk/javadoc/xdocs/faq.fml Sat Apr 21 08:24:44 2007 @@ -79,7 +79,17 @@ maven.javadoc.docletpath=${maven.repo.local}/gr.spinellis/jars/UmlGraph-4.6.jar maven.javadoc.usestandardparameters=true </source> - + <p> + Maven Javadoc plugin version 1.9 and newer + enables specifying custom doclet parameters. + This makes configuring UMLGraph's doclet possible, + for example, turning on extra class diagram adornments. + Adjust these as desired, referring to the UMLGraph documentation. + </p> +<source> +maven.javadoc.doclet.param.list=umlgraph.all +umlgraph.all.name=-all +</source> <li> Install dot (in <a href="http://www.graphviz.org">Graphviz</a>) and put on PATH (so UmlGraphDoc can run it); e.g. for Windows: @@ -88,6 +98,10 @@ GRAPHVIZ_HOME=(the path) PATH=%PATH%;%GRAPHVIZ_HOME%\bin </source> + <p> + Note that UmgGraphDoc outputs an error message + if it could not run dot. + </p> </ol> </p> <p> Modified: maven/maven-1/plugins/trunk/javadoc/xdocs/properties.xml URL: http://svn.apache.org/viewvc/maven/maven-1/plugins/trunk/javadoc/xdocs/properties.xml?view=diff&rev=531048&r1=531047&r2=531048 ============================================================================== --- maven/maven-1/plugins/trunk/javadoc/xdocs/properties.xml (original) +++ maven/maven-1/plugins/trunk/javadoc/xdocs/properties.xml Sat Apr 21 08:24:44 2007 @@ -340,10 +340,10 @@ <section name="Alternate Doclet Settings"> <table> <tr> - <th>Type</th> <th>Name</th> <th>Optional?</th> <th>Description</th> + <th>Default</th> </tr> <tr> <td>maven.javadoc.doclet</td> @@ -355,6 +355,7 @@ See <a href="faq.html#classdiagrams">Class Diagrams FAQ</a> as an example. </td> + <td>(none - calls the JavaDoc standard doclet)</td> </tr> <tr> <td>maven.javadoc.docletpath</td> @@ -365,6 +366,7 @@ <a href="http://ant.apache.org/manual/CoreTasks/javadoc.html">the ant javadoc task</a> documentation for more detail. </td> + <td>(none)</td> </tr> <tr> <td>maven.javadoc.usestandardparameters</td> @@ -378,6 +380,53 @@ the plugin does not use the standard doclet parameters unless this property is set. </td> + <td>(none)</td> + </tr> + <tr> + <td>maven.javadoc.doclet.param.list</td> + <td>Yes</td> + <td> + <p> + Delimeter separated list of property names + (see maven.javadoc.doclet.param.list.delim), + with each property defining a parameter name and value, + to pass to the doclet. + For example: <code>umlgraph.all,property2.abc,property3.def</code> + </p> + <p> + For every property listed, it expects 2 additional properties: + <dl> + <dt>(propertyname).name</dt> + <dd>The name of the parameter to pass to the doclet.</dd> + <dt>(propertyname).value</dt> + <dd> + The value of the parameter to pass to the doclet. + Note that this can be not specified, + if the parameter name is all that is needed. + </dd> + </dl> + </p> + <p> + For example, to specify the "-all" parameter to the doclet + and "-all" does not have a parameter value: +<source> +maven.javadoc.doclet.param.list=umlgraph.all +umlgraph.all.name=-all +</source> + </p> + </td> + <td>(none)</td> + </tr> + <tr> + <td>maven.javadoc.doclet.param.list.delim</td> + <td>Yes</td> + <td> + <p> + Property name delimeter for list of parameters specified in + maven.javadoc.doclet.param.list. + </p> + </td> + <td>, (comma)</td> </tr> </table> </section>