ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject RE: How do I specify multiple Windows directories in one <propert y name> statement?
Date Sat, 04 May 2002 02:11:48 GMT
--- Daniel Barclay <dbarclay@mercator.com> wrote:
> > "Fail" in what sense? Where?
> 
> In the sense that the excised example would end up as something 
> like "C:\xyz\dir1:C:\xyz\dir2".  Wouldn't that cause a problem.

To reiterate: Not if you're referencing that property in an attribute that
expects a path, since the path-separator colon will be converted to a
semicolon.

To make it 100% guaranteed not to be a problem (even in tasks like
<echo>), set a <path> with that property, then set a new property based on
the path's ID, and reference the new property everywhere your build file
currently references the property you're using now. For example (note that
I've changed your backslashes to foreslashes and kept the colon as the
path separator):

  <property name="some.path" value="C:/xyz/dir1:C:/xyz/dir2"/>
  <path id="whatever">
    <pathelement path="${some.path}"/>
  </path>
  <property name="whatever" refid="whatever"/>

  <target name="echoit">
    <echo>whatever = ${whatever}</echo>
  </target>

$ ant -f echoit
echoit:
     [echo] whatever = C:\xyz\dir1;C:\xyz\dir2

Note that the foreslashes are now backslashes and the path separator is
now a semicolon.

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

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


Mime
View raw message