ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Fuller <>
Subject Re: directory paths
Date Fri, 04 Mar 2005 12:55:55 GMT
rakesh mailgroups wrote:

>sometimes Ant gives you too many ways to do things and you cobble
>something together that works but you think can probably done easier.
>Here's what i am trying to do:
>My web.xml needs to contain a full path to a config file. This path
>should work whether on windows or unix. The location is always in a
>subdirectory of the base dir. Here's my Ant code:
><path id="location.frontservletxmlfile">
>	<pathelement location="${dir.web}" />
><pathconvert targetos="windows" property="win"
>refid="location.frontservletxmlfile" />
>   <echo>Path to xml file is: ${win}</echo>
>   <copy file="${dir.conf}/web.xml.template" toFile="${dir.web}/web.xml">
>      <filterset>
>	<filter token="xml.location" value="${win}" />      </filterset>
>   </copy>
>the xml file goes from:
an ever so slightly less complicated way....would be to define dir.web 
with ${file.seperator} instead of slashes....then you could drop the  

also if you are constantly doing the xml.location token replacement, try 
using the <copy/> task's filtering attribute and define a global build 
file filter.

gl, Jim Fuller

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message