ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
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
HTML:
    <property name="br" value="${java.line.separator}"/>
)


I think you should try a kind of this

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


Jan Matèrne

-----Ursprüngliche Nachricht-----
Von: Kiarna Boyd [mailto:kiarna@hotmail.com]
Gesendet am: Donnerstag, 13. März 2003 22:23
An: user@ant.apache.org
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}"
                delimiter=""
                target="newversion"
                param="thisEnv">

  </foreach>


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


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.

Kiarna





_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


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

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