This looks like a job for selectors. http://marc.theaimsgroup.com/?t=101458344000004&r=1&w=2 http://marc.theaimsgroup.com/?t=101493187900007&r=1&w=2
With a bit of luck Bruce will be throwing in an implementation in the next few days to catch Ant 1.5??? http://marc.theaimsgroup.com/?t=101522551700002&r=1&w=2 I think the syntax will be along the lines of the following, although I've not seen the implmentation yet... <zip destfile="${build.dir}/myzip"> <fileset dir="${src.dir}"> <filename pattern="*.*"/> <modified after="2002-04-15"/> </fileset> </zip> Rob ----- Original Message ----- From: "Curt Arnold" <[EMAIL PROTECTED]> To: "Ant Developers List" <[EMAIL PROTECTED]> Sent: Friday, April 26, 2002 6:15 AM Subject: Re: incremental zip or tar > Since nobody else has responded to this, I'll take a shot. > > Doing a quick scan of the source code for usage of the Date and Time didn't > uncover anything that looked like Ant could already do what you want to do. > > I definitely think that your approach should be to extend or hack the > FileSet and not to try to extend or hack the archiving tasks. > > The next question is whether you were proposing the question as something > that you think is a general need and should be integrated into Ant or this > is something that is a specialized need that can be accomplished by a hack. > > If you were proposing a general solution, then the right approach would be > to add some facility to FileSet to exclude files based on dates, maybe > adding a before and after attribute. However the timing is inconvienient to > get this added into Ant 1.5 release since the new feature window is closing > this weekend. > > If you want to do it as a hack to just get the job done, then I would try > this. > > 1. Derive a class from FileSet > 2. add a setBefore(Date d) and setAfter(Date d) methods > 3. overload getDirectoryScanner() and wrap the directory scanner with > another class that filters its results based on the before and after dates > > In your build file, add a typedef for your class > > <typedef name="myfileset" classname="com.example.MyFileSet"/> > > At the same level as a <target> add a <myfileset> and provide it with an id > > <myfileset id="zip-this" after="2002-04-15" dir="${src.dir}"> > <include name="*.*"/> > </myfileset> > > In the <zip> (or similar task) use a reference fileset to point to your > extended fileset > > <zip destfile="${build.dir}/myzip" basedir="${src.dir}"> > <fileset refid="zip-this"/> > </zip> > > If that doesn't work (which would probably due to something is the reference > mechanism not allowing mechanisms to derived classes), an alternative would > be to define a FileSet with an id and then have a task populate the > FileSet's patterns but that would be an even uglier hack. > > Not sure if either approach would work, but would appreciate hearing your > experiences. Good luck. > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
