diff --git a/docs/manual/CoreTypes/mapper.html b/docs/manual/CoreTypes/mapper.html index e56a081a3..15d97d4e2 100644 --- a/docs/manual/CoreTypes/mapper.html +++ b/docs/manual/CoreTypes/mapper.html @@ -239,6 +239,69 @@ that don't match the from pattern will be ignored.

Qlasses/dir/dir2/A.property +

+ The globmapper mapper can take the following extra attributes. +

+ + + + + + + + + + + + + + + +
AttributeDescriptionRequired
casesensitice + If this is false, the mapper will ignore case when matching the glob pattern. + This attribute can be true or false, the default is true. + Since ant 1.6.3. + No
handledirchar + If this is specified, the mapper will ignore the difference between the normal + directory separator characters - \ and /. + This attribute can be true or false, the default is false. + This attribute is useful for cross-platform build files. + Since ant 1.6.3. + No
+

+ An example: +

+
+      <pathconvert property="x" targetos="unix">
+        <path path="Aj.Java"/>
+        <mapper>
+        <chainedmapper>
+          <flattenmapper/>
+          <globmapper from="a*.java" to="*.java.bak" casesensitive="no"/>
+        </chainedmapper>
+        </mapper>
+      </pathconvert>
+      <echo>x is ${x}</echo>
+    
+

+ will output "x is j.java.bak". +

+

+ and +

+
+      <pathconvert property="x" targetos="unix">
+        <path path="d/e/f/j.java"/>
+        <mapper>
+          <globmapper from="${basedir}\d/e\*" to="*" ignoredirchar="yes"/>
+        </mapper>
+      </pathconvert>
+      <echo>x is ${x}</echo>
+    
+

+ will output "x is f/j.java". +

+

regexp

Both to and from define regular expressions. If the source file name matches the from @@ -254,7 +317,7 @@ another dollar-sign in Ant.

The regexp mapper needs a supporting library and an implementation of org.apache.tools.ant.util.regexp.RegexpMatcher that hides the specifics of the library. Ant comes with implementations for -the java.util.regex package of JDK 1.4, +the java.util.regex package of JDK 1.4 or higher, jakarta-regexp and jakarta-ORO. If you compile from sources and plan to use one of them, make sure the libraries are @@ -263,13 +326,16 @@ href="http://www.cacas.org/~wes/java/" target="_top">gnu.regexp or gnu.rex with Ant, see this article.

-

This means, you need optional.jar from the Ant release -you are using and one of the supported regular -expression libraries. Make sure, both will be loaded from the same +

This means, you need one of the supported regular expression + libraries and + the corresponding ant-[jakarta-oro, jakarta-regexp, apache-oro, apache-regexp}.jar +from the Ant release you are using. +Make sure, both will be loaded from the same classpath, that is either put them into your CLASSPATH, ANT_HOME/lib directory or a nested <classpath> element of the mapper - you cannot have -optional.jar in ANT_HOME/lib and the library +ant-[jakarta-oro, jakarta-regexp, apache-oro, apache-regexp].jar in ANT_HOME/lib + and the library in a nested <classpath>.

Ant will choose the regular-expression library based on the following algorithm:

@@ -337,8 +403,8 @@ jakarta-ORO and finally try jakarta-regexp.
-<mapper type="regexp" from="^(.*)\.(.*)$$" to="\2.\1"/>
-<regexpmapper from="^(.*)\.(.*)$$" to="\2.\1"/>
+<mapper type="regexp" from="^(.*)\.(.*)$$" to="\2.\1"/>
+<regexpmapper from="^(.*)\.(.*)$$&" to="\2.\1"/>
 
@@ -363,8 +429,8 @@ jakarta-ORO and finally try jakarta-regexp.
-<mapper type="regexp" from="^(.*?)(\$$[^/\\\.]*)?\.class$$" to="\1.java"/>
-<regexpmapper from="^(.*?)(\$$[^/\\\.]*)?\.class$$" to="\1.java"/>
+<mapper type="regexp" from="^(.*?)(\$$[^/\\\.]*)?\.class$$" to="\1.java"/>
+<regexpmapper from="^(.*?)(\$$[^/\\\.]*)?\.class$$" to="\1.java"/>
 
@@ -388,7 +454,65 @@ jakarta-ORO and finally try jakarta-regexp.
java/lang/ClassLoader.java
- +

+ The regexpmapper mapper can take the following extra attributes. +

+ + + + + + + + + + + + + + + +
AttributeDescriptionRequired
casesensitive + If this is false, the mapper will ignore case when matching the pattern. + This attribute can be true or false, the default is true. + Since ant 1.6.3. + No
handledirchar + If this is specified, the mapper will treat a \ character in a filename + as a / for the purposes of matching. + This attribute can be true or false, the default is false. + This attribute is useful for cross-platform build files. + Since ant 1.6.3. + No
+

+ An example: +

+
+      <pathconvert property="x" targetos="unix">
+        <path path="Aj.Java"/>
+        <chainedmapper>
+          <flattenmapper/>
+          <globmapper from="a(*.)java" to="\1.java.bak" casesensitive="no"/>
+        </chainedmapper>
+      </pathconvert>
+      <echo>x is ${x}</echo>
+    
+

+ will output "x is j.java.bak". +

+

+ and +

+
+    <pathconvert property="hd.prop" targetos="windows">
+      <path path="d\e/f\j.java"/>
+      <chainedmapper>
+        <regexpmapper from="${basedir}/d/e/(.*)" to="\1" handledirchar="yes"/>
+      </chainedmapper>
+    </pathconvert>
+    
+

+ will set hd.prop to "f\j.java". +

package

Sharing the same syntax as the glob mapper, the package mapper replaces @@ -504,6 +628,55 @@ with <uptodate> and <junit> output.

The chained mapper has no corresponding <mapper type> attribute.

+ + + + + +

filtermapper (since ant 1.6.3)

+

+ This mapper implementation applies a filterchain + to the source file name. +

+Examples: +
+<filtermapper>
+  <replacestring from="\" to="/"/>
+</filtermapper>
+
+ + + + + + + + + + +
Source file nameTarget file names
foo\bar\A.javafoo/bar/A.java
+
+<filtermapper>
+  <scriptfilter language="beanshell">
+    self.setToken(self.getToken().toUpperCase());
+  </scriptfilter>
+</filtermapper>
+
+ + + + + + + + + + +
Source file nameTarget file names
foo\bar\A.javaFOO\BAR\A.JAVA
+ +

The filtermapper has no corresponding + <mapper type> attribute. +


Copyright © 2000-2004 The Apache Software Foundation. All rights Reserved.