ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Berry" <Craig.Be...@portblue.com>
Subject Correcting dirsep on env variables?
Date Wed, 19 Feb 2003 19:24:05 GMT
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
 

Mime
View raw message