ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject RE: How do I specify multiple Windows directories in one <propert y name> statement?
Date Thu, 02 May 2002 14:26:58 GMT
Just do it the right ANT way, by using relative directories, <path>, and
convert it to a property (at least IMHO):

1) Assuming your build file is in C:\project\

<project name="whatever" basedir=".">

    <path id="test-path-id">
      <pathelement location="src1" />
      <pathelement location="src2" />
    <property name="test.path"
              refid="test-path-id" />


The location attribute of <pathelement> is relative to basedir of <project>
when the specified path in not absolute.

2) If your two directories are unrelated to your projects (then why would
you path src/ dirs in the path!?!?!?), then is should be

    <path id="test-path-id">
      <pathelement path="C:/project/src1" /> <!-- path or location? -->
      <pathelement path="C:/project/src2" /> <!-- Diane? Stefan? -->
    <property name="test.path"
              refid="test-path-id" />

In case ANT gets confused by the C:, thinking the colon is a path separator
(which I don't think it should), you can still omit it entirely, and use
<pathconvert> to put it back, use /C_colon and replace to C:...

3) Finally, maybe the only answer you wanted:

    <property name="test.path"
              value="C:/project/src1;C:/project/src2" />

PS: Always use forward slashes in ANT, as back slash is the XML escape
character, and ANT takes care of converting it correctly for the current
platform, and <pathconvert> converts it to a different target platform if

-----Original Message-----
From: Tony [] 
Sent: Wednesday, May 01, 2002 9:54 PM
Subject: How do I specify multiple Windows directories in one <property
name> statement?

Hi Folks

How do I write the line below for Windows

<property name="test.path" value="/home/project/src1:/home/project/src2"/>

this time


If I write

<property name="test.path" value="C:\project\src1:C:\project\src2"/>

then this is clearly wrong since Windows uses ":" in its paths names.  So
can someone please tell me how I write this in Widows.



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

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

View raw message