You can use the ant-contrib for task:
<target name="dir">
<mkdir dir="sub"/>
<mkdir dir="sub/a"/>
<mkdir dir="sub/b"/>
<mkdir dir="sub/c"/>
<ac:for param="dir">
<dirset dir="sub"/>
<sequential>
<echo>dir is @{dir}</echo>
</sequential>
</ac:for>
</target>
outputs:
dir:
[echo] dir is /home/preilly/learning/a/for/sub
[echo] dir is /home/preilly/learning/a/for/sub/a
[echo] dir is /home/preilly/learning/a/for/sub/b
[echo] dir is /home/preilly/learning/a/for/sub/c
Peter
Nicolas Vervelle wrote:
I can see how to use this tasks for 'one' subdirectory, but is there a
task that will permit to call a subtask for each subdirectory ?
Something like :
<foreach dir='rootDir'>
<antcall target="oneDir">
<param name="currentDir" value="?currentDir?">
</antcall>
</foreach>
Nicolas
[EMAIL PROTECTED] wrote:
mmh - my first impression is that
<fileset>, <present>, <filterchain>, <mapper>, <replace>,
<replaceregexp>
could be helpful.
Jan
-----Urspr�ngliche Nachricht-----
Von: Nicolas Vervelle [mailto:[EMAIL PROTECTED]
Gesendet am: Mittwoch, 23. M�rz 2005 12:05
An: [email protected]
Betreff: Executing a task in each subdirectory
Hi,
I have a directory tree where each directory can contains files
named in the form index.*.html. (* represents the code for a
language: en, fr, ...)
Each index.*.html contains lines in the form <*>text</*>.
For each directory, I would like to :
- remove the <*>text</*> in each file if index.*.html is absent in
the directory, an
- replace the <*>text</*> in each file by text if index.*.html is
present in the directory.
Anyone has an idea on how to do this ?
My main problem is taking each directory (and subdirectory) one
after an other.
TIA
Nicolas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]