ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Barclay <Daniel.Barc...@digitalfocus.com>
Subject Ant equiv. of touching flag file to control rebuilding
Date Tue, 24 Apr 2001 14:50:38 GMT
What's the Ant equivalent of the following pattern in Make files?

.flagfile : someSourceFiles
	someCommand someSourceFiles && \
	touch .flagfile


That is, I want to run some command only if I need to.  The state 
updated by the command is not accessible to make.  (It's not a simple
output file whose timestamp can be checked by make.)  Therefore, I use 
a flag file to indicate when the command was last run, and modify the
build commands to update the timestamp of the flag file.

For a general-purpose command (not a specific defined task, but something 
run with Exec or done with a sequence of file-system tasks (e.g., Copy)),
how would the above case be handled in Ant? 

Is there any general way of comparing file timestamps?  Can the results
of such a comparison be used in a target's "if" or "unless" attributes?

Can scripting features handle such timestamp checks and conditional
execution?


Thanks,
Daniel
-- 
Daniel Barclay
Digital Focus
Daniel.Barclay@digitalfocus.com

Mime
View raw message