Have a look at the 'uptodate' task. You can use it to set a property if
a source file is more up to date than a target. You can then check if
the property is set using the if/unless attributes. An example (from
memory, so might not run as typed) is below.
The above example should set the property "fileUpToDate" if the target
file is more up to date than the source file. The "conditionalStuff"
target will then only execute if the property doesn't have a value,
i.e. if the source file has a more recent date than the target.
The uptodate task can be used to check multiple files - see the docs,
or mail me off list if you have further questions.
Regards,
Neil
On 9 Apr 2005, at 12:13, Rolf Howarth wrote:
Slightly off-topic, but I wonder if anyone can answer a quick Ant
question? Most tasks within Ant are clever and "know" which are the
output file(s) and which the input(s) so it knows whether the outputs
are out of date and need to be rebuilt. However, I have a few external
scripts and want to explicitly say "execute this task (or this target)
only if file x is older than file y or if file x is missing", just
like an old-fashioned makefile. I'm sure I'm missing something obvious
but I can't immediately work out how to do this from the Ant manual.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden