From db060df3c3ec41339c5fcbf8c177ec9f01299cae Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Wed, 23 Nov 2005 18:14:04 +0000 Subject: [PATCH] add filenamemapper support to . Bugzilla 37604. Submitted by Maarten Coene. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@348509 13f79535-47bb-0310-9956-ffa450edef68 --- CONTRIBUTORS | 1 + WHATSNEW | 5 ++++- src/etc/testcases/taskdefs/style/build.xml | 10 +++++++++- .../org/apache/tools/ant/taskdefs/XSLTProcess.java | 12 ++++++++++++ .../org/apache/tools/ant/taskdefs/StyleTest.java | 7 +++++++ 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 8f24b6a7b..e356c025c 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -130,6 +130,7 @@ Les Hughes Levi Cook lucas Ludovic Claude +Maarten Coene Magesh Umasankar Maneesh Sahu Marcel Schutte diff --git a/WHATSNEW b/WHATSNEW index a9a10d11b..c0bf7ddaa 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -309,7 +309,10 @@ Other changes: * New task that can turn a file reference into an absolute file:// url; and nested filesets/paths into a (space, comma, whatever) separated - list of URLs. Useful for RMI classpath setup, amongst other things. + list of URLs. Useful for RMI classpath setup, amongst other things. + +* now accepts nested FileNameMappers e.g. . + Bugzilla report 37604. Changes from Ant 1.6.4 to Ant 1.6.5 diff --git a/src/etc/testcases/taskdefs/style/build.xml b/src/etc/testcases/taskdefs/style/build.xml index 5d5bb978a..2dc985c95 100644 --- a/src/etc/testcases/taskdefs/style/build.xml +++ b/src/etc/testcases/taskdefs/style/build.xml @@ -57,6 +57,14 @@ + + + + + + + + - \ No newline at end of file + diff --git a/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java b/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java index d01bac32c..869f96e9f 100644 --- a/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java +++ b/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java @@ -213,6 +213,18 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { resources.add(rc); } + /** + * Adds a nested filenamemapper. + * @param fileNameMapper the mapper to add + * @exception BuildException if more than one mapper is defined + * @since Ant 1.7.0 + */ + public void add(FileNameMapper fileNameMapper) throws BuildException { + Mapper mapper = new Mapper(getProject()); + mapper.add(fileNameMapper); + addMapper(mapper); + } + /** * Executes the task. * diff --git a/src/testcases/org/apache/tools/ant/taskdefs/StyleTest.java b/src/testcases/org/apache/tools/ant/taskdefs/StyleTest.java index fa38c1320..ef63f0eb0 100644 --- a/src/testcases/org/apache/tools/ant/taskdefs/StyleTest.java +++ b/src/testcases/org/apache/tools/ant/taskdefs/StyleTest.java @@ -105,6 +105,13 @@ public class StyleTest extends BuildFileTest { "set='myvalue'"); } + public void testTypedMapper() throws Exception { + assertTrue(!getProject().resolveFile("out/out.xml").exists()); + expectFileContains("testTypedMapper", + "out/out.xml", + "set='myvalue'"); + } + public void testDirectoryHierarchyWithDirMatching() throws Exception { executeTarget("testDirectoryHierarchyWithDirMatching"); assertTrue(getProject().resolveFile("out/dest/level1/data.html")