ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mathieu Champlon <>
Subject Re: Task processing a DirSet one by one?
Date Mon, 21 Aug 2006 10:12:22 GMT
Chaudhuri, Hiran a écrit :
> Hi there.
> I have a directory with several subdirectories. Each subdirectory shall
> be zipped up in its own file.
> As the number of subdirectories can vary, I do not want to code each zip
> task explicitly but rather use a loop with a DirectorySet.
> Which Ant task can process a Directory/FileSet and call another task
> (here zip) for each entry found?
> directory/subdir1 ->
> directory/subdir2 ->
> ...
Hi !

You can use the for/foreach task from ant-contrib with a dirset.

Something like :

<for param="subdir">
  <dirset dir="directory" includes="*"/>
    <zip destfile="@{subdir}.zip">
      <fileset dir="directory" includes="@{subdir}/**"/>

(Sorry for any typo :p)


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

View raw message