ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <levylamb...@tiscali-dsl.de>
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}"/>
</path>
<pathconvert refid="mypath" property="mypath.unix" targetos="unix"/>
<echo message="${mypath.unix}"/>
</project>
===> output
     [echo] C:/Dokumente und Einstellungen/Administrator
is that what you want ?
----- Original Message -----
From: "Craig Berry" <Craig.Berry@portblue.com>
To: <user@ant.apache.org>
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}"/>
</filterset>

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
appreciated.

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


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



Mime
View raw message