Bugzilla 37604. Submitted by Maarten Coene. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@348509 13f79535-47bb-0310-9956-ffa450edef68master
@@ -130,6 +130,7 @@ Les Hughes | |||||
Levi Cook | Levi Cook | ||||
lucas | lucas | ||||
Ludovic Claude | Ludovic Claude | ||||
Maarten Coene | |||||
Magesh Umasankar | Magesh Umasankar | ||||
Maneesh Sahu | Maneesh Sahu | ||||
Marcel Schutte | Marcel Schutte | ||||
@@ -309,7 +309,10 @@ Other changes: | |||||
* New task <makeurl> that can turn a file reference into an absolute file:// | * New task <makeurl> that can turn a file reference into an absolute file:// | ||||
url; and nested filesets/paths into a (space, comma, whatever) separated | 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. | |||||
* <xslt> now accepts nested FileNameMappers e.g. <globmapper>. | |||||
Bugzilla report 37604. | |||||
Changes from Ant 1.6.4 to Ant 1.6.5 | Changes from Ant 1.6.4 to Ant 1.6.5 | ||||
@@ -57,6 +57,14 @@ | |||||
</xslt> | </xslt> | ||||
</target> | </target> | ||||
<target name="testTypedMapper"> | |||||
<property name="value" value="myvalue"/> | |||||
<xslt style="printParams.xsl" destDir="${out.dir}" basedir="."> | |||||
<param name="set" expression="${value}"/> | |||||
<globmapper from="data.*" to="out.*"/> | |||||
</xslt> | |||||
</target> | |||||
<target name="testExplicitFileset"> | <target name="testExplicitFileset"> | ||||
<property name="value" value="myvalue"/> | <property name="value" value="myvalue"/> | ||||
<xslt style="printParams.xsl" destDir="${out.dir}" | <xslt style="printParams.xsl" destDir="${out.dir}" | ||||
@@ -99,4 +107,4 @@ | |||||
</copy> | </copy> | ||||
</target> | </target> | ||||
</project> | |||||
</project> |
@@ -213,6 +213,18 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
resources.add(rc); | 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. | * Executes the task. | ||||
* | * | ||||
@@ -105,6 +105,13 @@ public class StyleTest extends BuildFileTest { | |||||
"set='myvalue'"); | "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 { | public void testDirectoryHierarchyWithDirMatching() throws Exception { | ||||
executeTarget("testDirectoryHierarchyWithDirMatching"); | executeTarget("testDirectoryHierarchyWithDirMatching"); | ||||
assertTrue(getProject().resolveFile("out/dest/level1/data.html") | assertTrue(getProject().resolveFile("out/dest/level1/data.html") | ||||