MPXDOC-123 :

A new property is added : maven.xdoc.xml.copy
A comma separated list of patterns to specify xml files to copy from ${maven.docs.src} to ${maven.docs.dest} without to perform a transformation to HTML.
The default value is empty (no xml files are copied).


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@116185 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
aheritier
2004-10-25 22:45:53 +00:00
parent deabf13156
commit e87957e80a
8 changed files with 139 additions and 0 deletions

View File

@@ -280,6 +280,9 @@
<j:new var="dirMapper" className="org.apache.maven.util.CaseInsensitiveGlobPatternMapper"/>
<j:setProperties object="${dirMapper}" from="${fromDirPattern}" to="${toDirPattern}"/>
<maven:pluginVar var="maven_xdoc_xml_copy_pattern"
plugin='maven-xdoc-plugin' property='maven.xdoc.xml.copy' />
<fileScanner var="docFiles">
<fileset dir="${srcdir}">
<patternset>
@@ -287,6 +290,12 @@
<exclude name="**/template.xml"/>
<exclude name="**/navigation.xml"/>
<exclude name="changes.xml"/>
<j:if test="${maven_xdoc_xml_copy_pattern!=null and !maven_xdoc_xml_copy_pattern.equals('')}">
<util:tokenize var="xmlPatterns" delim=",">${maven_xdoc_xml_copy_pattern}</util:tokenize>
<j:forEach var="xmlPattern" items="${xmlPatterns}">
<exclude name="${xmlPattern}"/>
</j:forEach>
</j:if>
<include name="**/*.xml"/>
</patternset>
</fileset>
@@ -597,6 +606,10 @@
<j:if test="${maven.docs.src.available}">
<log:info>
Copying user supplied resources.
</log:info>
<!-- Copy user supplied resources -->
<copy todir="${maven.docs.dest}" filtering="no">
<fileset dir="${maven.docs.src}">
@@ -623,6 +636,25 @@
</util:available>
</j:if>
<maven:pluginVar var="maven_xdoc_xml_copy_pattern"
plugin='maven-xdoc-plugin' property='maven.xdoc.xml.copy' />
<j:if test="${maven_xdoc_xml_copy_pattern!=null and !maven_xdoc_xml_copy_pattern.equals('')}">
<util:tokenize var="xmlPatterns" delim=",">${maven_xdoc_xml_copy_pattern}</util:tokenize>
<log:info>
Copying user supplied xml files.
</log:info>
<!-- Copy xml files -->
<copy todir="${maven.docs.dest}" filtering="no">
<fileset dir="${maven.docs.src}">
<j:forEach var="xmlPattern" items="${xmlPatterns}">
<include name="${xmlPattern}"/>
</j:forEach>
</fileset>
</copy>
</j:if>
</goal>
<!-- ================================================================== -->

View File

@@ -80,3 +80,6 @@ maven.xdoc.projectInfo = cvs-usage.xml,\
project-info.xml,\
team-list.xml,\
downloads.jelly
# List of xml files (or patterns) that are copied but not transformed
#maven.xdoc.xml.copy=

View File

@@ -25,5 +25,10 @@
<assert:assertEquals expected="0" value="${countLogo.intValue().toString()}" msg="Logo not found."/>
<x:set var="countUrl" select="count($linkcheckDoc/linkcheck/file/result[contains(child::target,'project-info.html')][contains(child::status,'NOT FOUND')])"/>
<assert:assertEquals expected="0" value="${countUrl.intValue().toString()}" msg="Url not found."/>
<!-- Test -->
<assert:assertFileExists file="${maven.docs.dest}/xml_copy_only.xml"/>
<assert:assertFileNotFound file="${maven.docs.dest}/xml_copy_only.html"/>
<assert:assertFileExists file="${maven.docs.dest}/myfile.export.xml"/>
<assert:assertFileNotFound file="${maven.docs.dest}/myfile.export.html"/>
</goal>
</project>

View File

@@ -0,0 +1,18 @@
# -------------------------------------------------------------------
# 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.
# -------------------------------------------------------------------
# List of xml files (or patterns) that are copied but not transformed
maven.xdoc.xml.copy=**/*copy_only.xml,**/*.export.xml

View File

@@ -0,0 +1,35 @@
<?xml version="1.0"?>
<!--
/*
* 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.
*/
-->
<document>
<properties>
<title>Xdoc test Document</title>
</properties>
<body>
<section name="test jslToSite tag">
<p>empty document</p>
<p>
This document is generated separately from other xdoc documents
but should retain the site stylesheet and navigation.
</p>
</section>
</body>
</document>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0"?>
<!--
/*
* 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.
*/
-->
<document>
<properties>
<title>Xdoc test Document</title>
</properties>
<body>
<section name="test jslToSite tag">
<p>empty document</p>
<p>
This document is generated separately from other xdoc documents
but should retain the site stylesheet and navigation.
</p>
</section>
</body>
</document>

View File

@@ -27,6 +27,7 @@
</properties>
<body>
<release version="1.9-SNAPSHOT" date="in CVS">
<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>
<action dev="aheritier" type="fix" issue="MPXDOC-117" due-to="Dennis Lundberg">Show version if maven.xdoc.date=right</action>
<action dev="aheritier" type="fix" issue="MPXDOC-115" due-to="Brent Worden">Allow header images and links to use relative paths</action>

View File

@@ -61,6 +61,16 @@
<code>${maven.build.dir}/generated-xdocs</code>.
</td>
</tr>
<tr>
<td>maven.xdoc.xml.copy</td>
<td>Yes</td>
<td>
A comma separated list of patterns to specify xml files to copy
from ${maven.docs.src} to ${maven.docs.dest} without
to perform a transformation to HTML.
The default value is empty (no xml files are copied).
</td>
</tr>
</table>
</section>
<section name="Localization Properties">