Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 65015 invoked from network); 26 Aug 2008 18:30:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Aug 2008 18:30:08 -0000 Received: (qmail 20611 invoked by uid 500); 26 Aug 2008 18:30:04 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 20571 invoked by uid 500); 26 Aug 2008 18:30:04 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 20560 invoked by uid 99); 26 Aug 2008 18:30:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Aug 2008 11:30:04 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [206.190.38.169] (HELO web51303.mail.re2.yahoo.com) (206.190.38.169) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 26 Aug 2008 18:29:05 +0000 Received: (qmail 59065 invoked by uid 60001); 26 Aug 2008 18:29:34 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Message-ID; b=oP2BkRC56pYeDpzMtVXsTfFrmmoiOgfX0fgfTQQRXDpte8cfvJ/+QLkdBIMEO26pP1tJSKzDVCQ9qlt6CUg735PS4pSCkRMNYuC8jggZa3F7N1ORuVVaOBUECitJMfVgPGwmPr7ANSku7bNS+U5L850Pb2IR04XcFDTuhbWmM5k=; X-YMail-OSG: PahJGDwVM1mmRqq1NBLusqQTCnyJtwi7lKfsC.8yUPB6OtQVobB2XFmAx2XlRtOONchKyuIDgtHjB2MIoxvB_7cTvlnOzoB4eGT85kSJxkJzPOA6Fxdb4iLXnIAkpNSSnOJSNye_9jwEiSEdA2GIvdco Received: from [72.214.217.34] by web51303.mail.re2.yahoo.com via HTTP; Tue, 26 Aug 2008 11:29:34 PDT X-Mailer: YahooMailWebService/0.7.218.2 Date: Tue, 26 Aug 2008 11:29:34 -0700 (PDT) From: David W Reply-To: davidw589@yahoo.com Subject: Re: Search a folder automatically? To: Ant Users List , David Weintraub In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1363534603-1219775374=:58553" Message-ID: <934563.58553.qm@web51303.mail.re2.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org --0-1363534603-1219775374=:58553 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi David,=20 =A0 Thanks so much for your reply. I use apache-ant-1.7.1 on Linux. I found tha= t my old Java source code still got compiled and run even though I left the= old corresponding compiled class file there.=20 =A0 What I wanted Ant to do is to=A0check a folder continuously (or check the f= older once every 3 or 5 minutes) to see if a new source code comes. If it i= s, then it goes to do more work. Otherwise it just either continue to searc= h or go to sleep again. Is this possible?=20 =A0 Thanks again,=20 =A0 David W. =A0 =A0 =A0 --- On Tue, 8/26/08, David Weintraub wrote: From: David Weintraub Subject: Re: Search a folder automatically? To: "Ant Users List" , davidw589@yahoo.com Date: Tuesday, August 26, 2008, 10:03 AM Take a look at "filesets". Also, in the task, you can specify a "src" directory. All *.java files in that directory will get compiled. If someone creates a new *.java file in the "src" directory, and did not delete the corresponding *.class files, then the task will only compile that new *.java file. If you change the source code in one *.java file, the task will only compile that one file and leave the others alone (as long as you didn't delete the corresponding *.class files). Almost all Ant tasks use timestamps to check whether or not it needs to do a particular task. For example, won't copy files if the files in the destination directory have a newer timestamp than the files in the source directory. won't rejar files if the timestamp of the jarfile is newer than all the source files that you specified are in that jarfile. Take a look at the tasks below: First of all, I always specify a "dest" directory. That way, I can easily create a clean target which simply deletes the ${dest.dir}. The first one uses a single "src" directory (which isn't uncommon). The second form allows me to specify multiple source directories, and allows me to just put all the files needed for compiling into a single ${class.dir}. To change the classpath, all I have to do is change the files in the ${class.dir}. I hope this answers your question. -- David Weintraub qazwart@gmail.com On Tue, Aug 26, 2008 at 11:30 AM, David W wrote: > Hi, > > I am a newbie in Ant field so I appreciate any replies from you. > > What I want to do is to let Ant search a folder automatically. If a piece of source code (say, Java source code) is put into that folder, then Ant fi= nds the code and begin to do more work. Can anybody tell me how to make Ant to search a folder automatically? > > Thanks so much! > > David > > > =0A=0A=0A --0-1363534603-1219775374=:58553--