Return-Path: Mailing-List: contact user-help@ant.apache.org; run by ezmlm Delivered-To: mailing list user@ant.apache.org Received: (qmail 69918 invoked from network); 15 Apr 2003 16:06:36 -0000 Received: from bay2-f92.bay2.hotmail.com (HELO hotmail.com) (65.54.247.92) by daedalus.apache.org with SMTP; 15 Apr 2003 16:06:36 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 15 Apr 2003 09:06:39 -0700 Received: from 205.246.2.35 by by2fd.bay2.hotmail.msn.com with HTTP; Tue, 15 Apr 2003 16:06:39 GMT X-Originating-IP: [205.246.2.35] X-Originating-Email: [richmwagner@hotmail.com] From: "Rich Wagner" To: user@ant.apache.org Bcc: Subject: RE: Anything like a "" task ? Date: Tue, 15 Apr 2003 16:06:39 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 15 Apr 2003 16:06:39.0661 (UTC) FILETIME=[FF9F2DD0:01C30368] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N >From: Dominique Devienne > >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... Well, in the interest of brevity, I simplified in my original pseudo-code. The body of the foreach in fact needs to (1) invoke a Java main program we have here at my company, which validates every XML file in the subdir against the file's schema, (2) invokes another Java utility which applies an XSLT script to every file in the subdir - though the utility does more than than (details I can't get into: the point is it's not feasible to replace this utility's invocation with a series of Xalan invocations: it's more complicated than that...), and (3) "native2ascii" is applied to every element of a corresponding outout subdir. >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 The Ant build file I'm writing is part of a web application installer/deployer which needs to run on Windows and UNIX platforms, so the OS-specific nature of isn't appealing... At this point, the -based approach is working just fine (and the installer can itself install the additional "ant-contrib" task JAR file), so while using might be an alternative, at this point pragmatics make this: "if it works, don't fix it..." Thanks, Rich Wagner > >-----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... > >--------------------------------------------------------------------- >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >For additional commands, e-mail: user-help@ant.apache.org > _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail