ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob Oxspring" <>
Subject Re: incremental zip or tar
Date Fri, 26 Apr 2002 08:08:58 GMT
This looks like a job for selectors.

With a bit of luck Bruce will be throwing in an implementation in the next
few days to catch Ant 1.5???

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"/>


----- Original Message -----
From: "Curt Arnold" <>
To: "Ant Developers List" <>
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
> uncover anything that looked like Ant could already do what you want to
> 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
> 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
> get this added into Ant 1.5 release since the new feature window is
> 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
> <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
> mechanism not allowing mechanisms to derived classes), an alternative
> 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:   <>
> For additional commands, e-mail: <>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message