Author: felipeal Date: Wed Feb 9 19:05:31 2005 New Revision: 153147 URL: http://svn.apache.org/viewcvs?view=rev&rev=153147 Log: MPXDOC-129: add a comment property for dependencies
Added: maven/maven-1/plugins/trunk/xdoc/src/plugin-test/testDependenciesComment/ maven/maven-1/plugins/trunk/xdoc/src/plugin-test/testDependenciesComment/maven.xml maven/maven-1/plugins/trunk/xdoc/src/plugin-test/testDependenciesComment/project.xml Modified: maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/DescribedDependency.java maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/templates/dependencies.xml maven/maven-1/plugins/trunk/xdoc/xdocs/changes.xml Modified: maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/DescribedDependency.java URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/DescribedDependency.java?view=diff&r1=153146&r2=153147 ============================================================================== --- maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/DescribedDependency.java (original) +++ maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/DescribedDependency.java Wed Feb 9 19:05:31 2005 @@ -23,7 +23,7 @@ * Dependency wrapper. Adds an url to download and a description. * * @author <a href="mailto:[EMAIL PROTECTED]">Michal Maczka</a> - * @version $Id: DescribedDependency.java,v 1.5 2004/09/21 13:47:53 brett Exp $ + * @version $Id$ */ public class DescribedDependency implements Comparable { @@ -222,4 +222,11 @@ return this.getId().compareTo(other.getId()); } + + /** + * Delegate method from Dependency.getProperty("comment") + */ + public String getComment() { + return dependency.getProperty("comment"); + } } Modified: maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/templates/dependencies.xml URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/templates/dependencies.xml?view=diff&r1=153146&r2=153147 ============================================================================== --- maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/templates/dependencies.xml (original) +++ maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/templates/dependencies.xml Wed Feb 9 19:05:31 2005 @@ -42,6 +42,7 @@ <th>Type</th> <th>Version</th> <th>URL</th> + <th>Comment</th> </tr> </thead> <tbody> @@ -54,6 +55,11 @@ #if ($dep.Url) <a href="${dep.Url}">${dep.Url}</a> #end + </td> + <td> + #if(${dep.comment}) + ${dep.comment} + #end </td> </tr> #end Added: maven/maven-1/plugins/trunk/xdoc/src/plugin-test/testDependenciesComment/maven.xml URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/src/plugin-test/testDependenciesComment/maven.xml?view=auto&rev=153147 ============================================================================== --- maven/maven-1/plugins/trunk/xdoc/src/plugin-test/testDependenciesComment/maven.xml (added) +++ maven/maven-1/plugins/trunk/xdoc/src/plugin-test/testDependenciesComment/maven.xml Wed Feb 9 19:05:31 2005 @@ -0,0 +1,53 @@ +<!-- +/* + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + --> +<project default="testPlugin" + xmlns:util="jelly:util" + xmlns:j="jelly:core" + xmlns:assert="assert" + xmlns:doc="doc" + xmlns:x="jelly:xml"> + + <goal name="testPlugin" prereqs="clean,xdoc:generate-from-pom, dependenciesTest"/> + + <goal name="dependenciesTest"> + <j:set var="depXmlPath" value="${maven.gen.docs}/dependencies.xml"/> + <assert:assertFileExists file="${depXmlPath}"/> + <util:file var="depXmlFile" name="${depXmlPath}"/> + <x:parse var="depXmlDom" xml="${depXmlFile}"/> + <x:set var="headerComment" select="string($depXmlDom/document/body/[EMAIL PROTECTED]'Dependencies']/table/thead/tr/th[5])"/> + <assert:assertEquals expected="Comment" value="${headerComment}"/> + <x:forEach var="tr" select="$depXmlDom/document/body/[EMAIL PROTECTED]'Dependencies']/table/tbody/*"> + <x:set var="depName" select="string($tr/td[1])"/> + <x:set var="comment" select="string($tr/td[5])"/> + <j:if test="${depName=='dom4j'}"> + <echo>Checking comment for dependency dom4j</echo> + <assert:assertEquals expected="Simple comment" value="${comment.trim()}"/> + </j:if> + <j:if test="${depName=='commons-jelly'}"> + <echo>Checking comment for dependency commons-jelly</echo> + <assert:assertEquals expected="" value="${comment.trim()}"/> + </j:if> + <j:if test="${depName=='velocity-dvsl'}"> + <echo>Checking comment for dependency velocity-dvsl</echo> + <assert:assertEquals expected="" value="${comment.trim()}"/> + </j:if> + </x:forEach> + + </goal> + +</project> Added: maven/maven-1/plugins/trunk/xdoc/src/plugin-test/testDependenciesComment/project.xml URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/src/plugin-test/testDependenciesComment/project.xml?view=auto&rev=153147 ============================================================================== --- maven/maven-1/plugins/trunk/xdoc/src/plugin-test/testDependenciesComment/project.xml (added) +++ maven/maven-1/plugins/trunk/xdoc/src/plugin-test/testDependenciesComment/project.xml Wed Feb 9 19:05:31 2005 @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/* + * Copyright 2001-2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + --> +<project> + <pomVersion>3</pomVersion> + <name>Test project for Maven Xdoc Plugin new feature: dependencies comment</name> + <shortDescription>Test for dependencies comment</shortDescription> + <description>Test project for Maven Xdoc Plugin new feature: dependencies comment (MPXDOC-129)</description> + <groupId>maven</groupId> + <artifactId>test-maven-xdoc-plugin-testDependenciesComment</artifactId> + <currentVersion>1.0</currentVersion> + <dependencies> + +<!-- dependency with a simple comment --> + <dependency> + <groupId>dom4j</groupId> + <artifactId>dom4j</artifactId> + <version>1.4-dev-8</version> + <properties> + <comment>Simple comment</comment> + </properties> + </dependency> + +<!-- dependency with a blank comment --> + <dependency> + <groupId>commons-jelly</groupId> + <artifactId>commons-jelly</artifactId> + <version>1.0-RC1</version> + <properties> + <comment/> + </properties> + </dependency> + +<!-- dependency with no comment at all --> + <dependency> + <groupId>velocity-dvsl</groupId> + <artifactId>velocity-dvsl</artifactId> + <version>0.45</version> + </dependency> + </dependencies> + + <reports> + <!-- set a bogus report --> + <report>maven-tasklist-plugin</report> + </reports> + +</project> Modified: maven/maven-1/plugins/trunk/xdoc/xdocs/changes.xml URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/xdocs/changes.xml?view=diff&r1=153146&r2=153147 ============================================================================== --- maven/maven-1/plugins/trunk/xdoc/xdocs/changes.xml (original) +++ maven/maven-1/plugins/trunk/xdoc/xdocs/changes.xml Wed Feb 9 19:05:31 2005 @@ -27,8 +27,9 @@ </properties> <body> <release version="1.9-SNAPSHOT" date="in CVS"> + <action dev="felipeal" type="add" issue="MPXDOC-129" due-to="Miguel Griffa">Add a <code>comment</code> property for dependencies</action> <action dev="brett" type="add">Added maven.xdoc.copy.excludes property which lists the files to exclude from the resources copy. This defaults to any images currently unused by Maven. Additionally, if you are not using the classic theme, maven.xdoc.copy.excludes.classic is used to eliminate images only for the classic theme</action> - <action dev="felipel" type="add" issue="MPXDOC-118">Added new tag <code><escapeXml></code>.</action> + <action dev="felipeal" type="add" issue="MPXDOC-118">Added new tag <code><escapeXml></code>.</action> <action dev="epugh" type="add" issue="MPXDOC-124" due-to="Shinobu Kawai">Maven xdoc plugin clean up generated velocity log as part of calling clean.</action> <action dev="aheritier" type="add" issue="MPXDOC-123">New property (maven.xdoc.xml.copy) to copy only and not transform some xml files provided in the ${maven.docs.src} directory.</action> <action dev="brett" type="update">Make compatible with Maven 1.1</action> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]