ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <>
Subject Re: Correcting dirsep on env variables?
Date Wed, 19 Feb 2003 20:27:22 GMT
<project name="test">
<property environment="env"/>
<path id="mypath">
      <pathelement location="${env.USERPROFILE}"/>
<pathconvert refid="mypath" property="mypath.unix" targetos="unix"/>
<echo message="${mypath.unix}"/>
===> output
     [echo] C:/Dokumente und Einstellungen/Administrator
is that what you want ?
----- Original Message -----
From: "Craig Berry" <>
To: <>
Sent: Wednesday, February 19, 2003 8:24 PM
Subject: Correcting dirsep on env variables?

For a multiplatform build, I am pulling some information about file paths
out of the environment using the usual task form:

      <property environment="env"/>

On windows systems, the env variables naming paths typically use the windows
\ dirsep.  This works fine when the resulting property values are used to
name files and dirs for use within Ant; however, I run into a problem when I
use them in a filter.  The (excerpted) filterset looks like this

<filterset id="portblue.filters">
<filter token="THISLOG4JDIR" value="${portblue.jboss.log}"/>

where portblue.jboss.log is a property built up from env.JBOSS_HOME, which
(on windows) typically contains \ characters.  These get passed through
unchanged to the destination file when the filter above is used, and the
tool trying to use the resulting file (log4j) doesn't handle them correctly
and therefore misbehaves.

So, the question:  Is there a way to create a new property from an old one
while applying a text filter or regex to the old value?  I see many ways to
do this to files, but not to property values.  Any assistance would be most

Craig Berry
Principal Architect and Technical Manager
(310) 566-7546

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

View raw message