ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <rambiusparkisan...@yahoo.com>
Subject Re: AW: Executing a task in each subdirectory
Date Wed, 23 Mar 2005 12:52:27 GMT
Hello Nicolas,

--- Nicolas Vervelle <nicolas.vervelle@steria.com>
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 :
Just to note, to <for> task is recommended over
<foreach> task.

> <foreach dir='rootDir'>
>   <antcall target="oneDir">
>     <param name="currentDir" value="?currentDir?">
>   </antcall>
> </foreach>
The following un-tested snippet might help you:
    <ac:for param="file">
      <fileset id="dirs" dir="...">
        <include name="the_dirs_you_need">
      </fileset>
      <sequential>
        <antcall target="oneDir">
          <param name="currentDir" value="@{file}">
        </antcall>  
      </sequential>
    </ac:for>

Actually it might be more appropriate to use <dirset>
instead of <fileset>...

HTH Ivan

> 
> Nicolas
> 
> Jan.Materne@rzf.fin-nrw.de wrote:
> 
> >mmh - my first impression is that
> ><fileset>, <present>, <filterchain>, <mapper>,
> <replace>, <replaceregexp>
> >could be helpful.
> >
> >Jan
> >
> >  
> >
> >>-----Ursprüngliche Nachricht-----
> >>Von: Nicolas Vervelle
> [mailto:nicolas.vervelle@steria.com]
> >>Gesendet am: Mittwoch, 23. März 2005 12:05
> >>An: user@ant.apache.org
> >>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:
> user-unsubscribe@ant.apache.org
> >>For additional commands, e-mail:
> user-help@ant.apache.org
> >>
> >>    
> >>
> >
> >  
> >
> 
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message