ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Ant equiv. of touching flag file to control rebuilding
Date Tue, 24 Apr 2001 15:08:15 GMT
Daniel Barclay <> wrote:

> What's the Ant equivalent of the following pattern in Make files?
> .flagfile : someSourceFiles
> 	someCommand someSourceFiles && \
> 	touch .flagfile

Probably the best thing you could do, was writing a task for
someCommand.  The alternative approach

<target ...>
  <apply executable="sometask">
    <srcfile />
    <fileset dir="." includes="someSourceFiles" />
    <mapper type="merge" to=".flagfile" />
  <touch file=".flagfile" />

and maybe delete .flagfile before using touch if running JDK < 1.2.

The apply task will compare the timestamp of someSourceFiles to the
one of .flagfile and run the command if the source files are newer or
.flagfile is not there.

An even more general approach would involve <uptodate> and target's
unless attribute.


View raw message