Return-Path: Mailing-List: contact user-help@ant.apache.org; run by ezmlm Delivered-To: mailing list user@ant.apache.org Received: (qmail 90138 invoked from network); 15 Apr 2003 15:06:21 -0000 Received: from junior.lgc.com (134.132.72.99) by daedalus.apache.org with SMTP; 15 Apr 2003 15:06:21 -0000 Received: from lgchvw01.lgc.com (lgchvw01.lgc.com [134.132.93.107]) by junior.lgc.com (8.11.7/8.11.3) with SMTP id h3FF5H501363 for ; Tue, 15 Apr 2003 10:05:17 -0500 (CDT) Received: from 134.132.93.152 by lgchvw01.lgc.com (InterScan E-Mail VirusWall NT); Tue, 15 Apr 2003 10:04:16 -0500 Received: by lgchexchbh.ad.lgc.com with Internet Mail Service (5.5.2653.19) id <2YGWS0X1>; Tue, 15 Apr 2003 10:06:21 -0500 Message-ID: From: Dominique Devienne To: "'Ant Users List'" Subject: RE: Anything like a "" task ? Date: Tue, 15 Apr 2003 10:06:14 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Instead of going the route, would you care to elaborate what this process of calling MyMainClass on every subdir does? Looks quite unusual from my perspective, and I somehow suspect another approach could be used... Also, you should check out . This does an implicit loop on a fileset (a pseudo- in this case, thanks to type="dir"), which quite often is better than using (which many people jump to incorrectly. It's useful in some cases, but not that often IMHO). Regards, --DD -----Original Message----- From: Rich Wagner [mailto:richmwagner@hotmail.com] Sent: Monday, April 14, 2003 1:50 PM To: user@ant.apache.org Cc: richmwagner@hotmail.com Subject: Anything like a "" task ? Hi Folks, I've been converting several Windows batch and UNIX shell scripts to Ant build files (quite successfully, I might add: platform independence is a good thing). But the last script includes a "for" loop that I don't know how to convert: it's basically doing something like this pseudo-code: $parentDir := "C:\x\y\z" foreach $subdir in $parent\* java -classpath ... MyMainClass $subdir end I know I could write my own custom "foreach" task, and I know I could write a simple Java "main" wrapper which invokes "MyMainClass#main" for each subdirectory in a given parent, but... I was hoping Ant provides an "off-the-shelf" way of expressing what I need to do. Any help ? I've searched the Ant manual and haven't found what I'm looking for: have I missed something ? Many thanks, Rich Wagner P.S. I've only been using Ant for a few weeks, but I've quickly become quite a fan. It's WAAAYYY better than "make". But beyond being a great replacement for "make", I've been able to replace lots of redundant script pairs, i.e. (1) I used to have functionally equivalent pairs of Windows 98 and Windows NT scripts with stupid little variations like "deltree" vs "rmdir": converting those pairs to single Ant files solves that, and (2) likewise for functionally equivalent Windows and UNIX script pairs... Many thanks to all those involved in providing this great tool...