From dev-return-83835-apmail-ant-dev-archive=ant.apache.org@ant.apache.org Thu Dec 18 11:45:31 2008 Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 71970 invoked from network); 18 Dec 2008 11:45:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Dec 2008 11:45:30 -0000 Received: (qmail 30150 invoked by uid 500); 18 Dec 2008 11:45:41 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 30082 invoked by uid 500); 18 Dec 2008 11:45:40 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 30071 invoked by uid 99); 18 Dec 2008 11:45:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Dec 2008 03:45:40 -0800 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=RCVD_ILLEGAL_IP,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [193.182.113.253] (HELO msc.se) (193.182.113.253) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Dec 2008 11:45:18 +0000 Received: by msc.se (Postfix, from userid 65534) id 31CB02258003; Thu, 18 Dec 2008 12:44:57 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by msc.se (Postfix) with ESMTP id 1E9532258001 for ; Thu, 18 Dec 2008 12:44:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at msc.se Received: from msc.se ([127.0.0.1]) by localhost (dominix.msc.local [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qcLrezu80zsP for ; Thu, 18 Dec 2008 12:44:39 +0100 (CET) Received: from [1.1.1.81] (unknown [1.1.6.254]) by msc.se (Postfix) with ESMTP id 615252258003 for ; Thu, 18 Dec 2008 12:44:39 +0100 (CET) Message-ID: <494A37A7.50701@msc.se> Date: Thu, 18 Dec 2008 12:44:39 +0100 From: Martin Holst Swende User-Agent: Thunderbird 2.0.0.18 (X11/20081125) MIME-Version: 1.0 To: Ant Developers List Subject: Re: AW: New iterating task References: <494A14E5.5000100@msc.se> <9EE86F1965E19E499C80DE52AC807B5502A47817@z011021.bk.fin.local> In-Reply-To: <9EE86F1965E19E499C80DE52AC807B5502A47817@z011021.bk.fin.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Yes, it does. However, the foreach-task, to my understanding, cannot as easily be used in the examples I provided, since it does not provide parametrized file-information (basedir, path, name and extension). Otherwise, it is very similar. /Martin Jan.Materne@rzf.fin-nrw.de wrote: > Sound very like ... > > Jan > > >> -----Ursprüngliche Nachricht----- >> Von: Martin Holst Swende [mailto:martin.holst_swende@msc.se] >> Gesendet: Donnerstag, 18. Dezember 2008 10:16 >> An: Ant Developers List >> Betreff: New iterating task >> >> Hi all, >> >> I have a little utility-task that I wrote because I did not find any >> better alternative - but maybe I missed something obvious. So >> I thought >> I would contribute it, if there is any interest. >> >> Anyway, it is a kind of file iterator meant to be used on >> tasks that are >> not written to handle multiple files. Also a few other uses, such as >> manipulating and/or preserve paths and filenames in the process . Here >> is how I use it : >> >> >> >> >> >> >> >> >> >> >> >> >> Dir : ${dir} >> Path : ${path} >> Filename:${filename} >> Extension:${extension} >> Extra-param: ${test} >> >> >> >> >> What it does is, for each entry in the fileset, it calls the target >> (myecho), and sets these properties : dir, path, filename, >> extension and >> any supplied extra parameters. It just lists files, so far. >> >> The fully qualified path is created in this manner : >> >> dir + path + filename + "." + extension >> >> >> One way of using it is if I have a dir-structure, say a photoalbum, >> where thumbnails have already been generated in the same >> structure. If I >> want to copy all thumbnails, but keep their directory >> structure, normal >> file-copy will not suffice (since it will copy all to same directory). >> But I can do this : >> >> >> >> >> >> >> >> > todir="thumbs/${path}"/> >> >> >> The todir will retain path, and copy files into e.g >> "thumbs/2008/01/21/img01_thumb.jpg" . >> >> And if I have a task that scales images, I could set it up like this : >> >> >> >> >> >> >> >> >> > outfile="thumbs/${path}${filename}_thumb.${extension}" size="${size}"/> >> >> >> This way, I can iterate a task not built for it (in this case >> "rescale") >> and be pretty flexible with the input parameters to that task. >> >> So, have I re-invented the wheel? >> >> Regards, >> Martin Holst Swende >> >> -- >> Martin Holst Swende ................. MSC Konsult AB >> tel: +46(0)70 9519098 ............... Vasagatan 52 >> martin.holst_swende@msc.se .......... 111 20 Stockholm >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org >> For additional commands, e-mail: dev-help@ant.apache.org >> >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org > > -- Martin Holst Swende ................. MSC Konsult AB tel: +46(0)70 9519098 ............... Vasagatan 52 martin.holst_swende@msc.se .......... 111 20 Stockholm --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org