|
PathconvertDescriptionConverts a nested Nested Parameters
Parameters specified as nested elementsmapSpecifies the mapping of path prefixes between Unix and Windows.
Each map element specifies a single replacement map to be applied to the elements of the path being processed. If no map entries are specified, then no path prefix mapping is performed. Note: The map elements are applied in the order specified,
and only the first matching map element is applied. So, the ordering of
your map elements can be important, if any pathIf the ExamplesIn the examples below, assume that the Example 1<path id="wl.path"> <pathelement location="${wl.home}/lib/weblogicaux.jar"/> <pathelement location="${wl.home}/classes"/> <pathelement location="${wl.home}/mssqlserver4/classes"/> <pathelement location="c:\winnt\System32"/> </path> <pathconvert targetos="unix" property="wl.path.unix" refid="wl.path"> <map from="${wl.home}" to="${wl.home.unix}"/> <map from="c:" to=""/> </pathconvert> will generate the path shown below
and store it in the property named /weblogic/lib/weblogicaux.jar:/weblogic/classes:/weblogic/mssqlserver4/classes:/WINNT/SYSTEM32 Example 2Given a FileList defined as:<filelist id="custom_tasks.jars" dir="${env.HOME}/ant/lib" files="njavac.jar,xproperty.jar"/>then: <pathconvert targetos="unix" property="custom_tasks.jars" refid="custom_tasks.jars"> <map from="${env.HOME}" to="/usr/local"/> </pathconvert>will convert the list of files to the following Unix path: /usr/local/ant/lib/njavac.jar:/usr/local/ant/lib/xproperty.jar Example 3<fileset dir="${src.dir}" id="src.files"> <include name="**/*.java"/> </fileset> <pathconvert pathsep="," property="javafiles" refid="src.files"/> This example takes the set of files determined by the fileset (all files ending in .java), joins them together separated by commas, and places the resulting list into the property javafiles. The directory separator is not specified, so it defaults to the appropriate character for the current platform. Such a list could then be used in another task, like javadoc, that requires a comma separated list of files. Copyright © 2001-2002 Apache Software Foundation. All rights Reserved. |