ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <>
Subject Re: Time-based dependencies
Date Wed, 12 Jul 2000 19:50:45 GMT

Even with Marius' 'obsolete' task, your original proposed task sequence is
only going to download the zipfile if it doesnt exis't on the local system.
So if the web based file changes, those changes will not propagate as far as
the unzipped file unless you delete the local copy.

What you'd need to do is extend the GET task to use the appropriate HTTP
headers to request a target file only if it is newer than the local copy,
just as if the client were updating its web cache. It might also be
appropriate to have the downloaded local copy have its date set to that of
the remote file, but that is hazardous as (a) you can't do that pre JDK1.2
and (b) sometimes it isnt always appropriate. Making that an (off by
default) option would be the sensible choice.


[A more powerful variant GET task is something I've debated doing in my
copious free time; full WebDAV method calls using the Slide client side is
the ideal goal, but perhaps timestamping would be a useful first step].

----- Original Message -----
From: "Phil Hanna" <>
To: <>
Sent: Wednesday, July 12, 2000 12:12
Subject: RE: Time-based dependencies

Thanks, Glenn.  You're right, this is closer to a solution.

The example I gave needed to test foo.bat to see if it was *older* than, not newer.  In other words, if I have foo.bat from Monday and there
is a dated Tuesday, my foo.bat is out of date, and I need to do the

This is analogous to compile - link - create DLL for .c files.  In make, you
set up targets (well, actually there are built-in rules, but let's pretend
there aren't) that declare the .dll file to be dependent on the .obj, and
the .obj on the .c.  make figures out which if any are out of date and
starts the build at the appropriate point.

Now that I think of it, perhaps this could be accomplished by a custom task
"older" similar to "available":

<target name="init">
   <older first="foo.bat" second="" property=""/>

<target name="unzip" if="" depends="init">
... unzip

The implementation should set the property to true if the first object does
not exist or if its timestamp is less than the timestamp of the second


What I think I need is something like

<target name="run" depends="unzip">...</target>
<target name="unzip" depends="download"
<target name="download" if="foo.zip_does_not_exist">...</target>

Am I missing something obvious? make handles this easily.

Phil Hanna
E-Commerce Solutions
SAS Institute, Inc.
(919) 677-8000 x4284

View raw message