ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rakesh mailgroups <rakesh.mailgro...@gmail.com>
Subject directory paths
Date Fri, 04 Mar 2005 11:49:18 GMT
Hi,

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}" />
</path>
...
<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:
<param-value>@xml.location@/frontcontroller.xml</param-value>
to
<param-value>C:\Projects\HelloSample\web\WEB-INF/frontcontroller.xml</param-value>

It does work (on windows, haven't tested on Unix yet) but is their an
easier way???? It seems so long winded!

Thanks

Rakesh

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message