ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Pastrana" <alb...@ludicus.com>
Subject new ant task proposal
Date Fri, 13 Jun 2003 11:18:35 GMT
Hi to all,

First of all, apologizes for my english (I'm catalan) and for my message, if
it is not posted to the proper list.

I've been using ant for a long, and I've always thought that it lacks a
useful functionality, this is the possibility to make a loop over a group of
dirs (or files).

I needed this because in several build.xml files I would like to perform the
same build tasks for a group of modules. I supose I'm not the only one that
uses .sh or .bat files to perform similar things.

Last week was the last, I decided to make a little task to loop over a
directory contents and perform a task for every one of the directories
inside it. This task is very simple, it extends the CallTarget task and
takes only two new arguments:
- dir: the name of the directory you want to loop over
- propertyName: the name of the property you want to put the value of every
subdir name (by default is current.dir)

Then the task is really easy to use, it's something like that:
<target name="echodirname">
  <echo>${current.dir}</echo>
</target>
<target name="doloop">
  <taskdef classname="LoopTask" name="loop"/>
  <loop dir="./" target="echodirname"/>
</target>

It's very useful for me, and I would like this task to be added to Ant core
tasks, because I think it could interest to a lot of people. If not, it
would be nice also to add it to external tasks. The problem is that I cannot
spend time on it and I can't compromise on solving bugs and/or extending it.

For example, it would be nice to extend the task and take the list of
dirs/files to loop over from a fileset, but my very rudimentary knowledge of
ant made impossible to me to extend the task and add compatibility for
fileset :((

Well, that's all, I hope you to understand my english ;) and some of you to
suggest me a solution.

cheers

  albert




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


Mime
View raw message