ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject AW: foreach directory copy question
Date Fri, 14 Mar 2003 07:39:34 GMT
Java - and therefore Ant - stores the newline in java.line.separator.
You can access it with ${java.line.separator}.
(Because that´s so long I usually define a short cut for this - like <br> in
    <property name="br" value="${java.line.separator}"/>

I think you should try a kind of this

<foreach target="newversion" param="thisEnv">
        <dirset dir="theDirectoryWhereYouWantToDoThe_ls_" />

Jan Matèrne

-----Ursprüngliche Nachricht-----
Von: Kiarna Boyd []
Gesendet am: Donnerstag, 13. März 2003 22:23
Betreff: foreach directory copy question

Good afternoon,

I'm trying to copy the contents of a master directory to several client 
directories as part of my build.
The requirements include not to overwrite some of the existing client build 
sub dirs.

I read the archieves and saw a section on the topic and Simon was kind 
enough to send me some examples using foreach.

However I am having a hard time understanding some of it and would greatly 
appreciate your assistance.

So to begin the masterdir
I also need to know how to change the delimiter in the foreach to new line 
rather than coma. So I may use the out put form unix 'ls'

delimiter=? what is the ant symbol for newline?

I'd like to do the list from a Unix ls cmd to get a current listing of the 
new client directories each time the build is run.

<foreach list="${dev.env}"


  <target name="newversion">
        <echo message="environment: ${thisEnv}"/>
        <copy todir="${builddir}/${thisEnv}">
            <fileset dir="${masterdir}"/>

I believe I have to add a filset exclude for the sub directories I do not 
want copied.

I tried to use wildcards but ant actually made directories named '**'.

Thank you for your time.


Add photos to your messages with MSN 8. Get 2 months FREE*.

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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message