How to execute an Ant task only when source files have been modified?

Posted by hughalexb on Stack Overflow See other posts from Stack Overflow or by hughalexb
Published on 2009-02-02T16:46:17Z Indexed on 2010/03/26 9:23 UTC
Read the original article Hit count: 279

Filed under:
|
|
|

There must be an easy way to do this. I build a Flex app using ant that depends on a SWC library, which works fine except that it rebuilds the library whether it needs to or not. How do I tell ant to only run the task if any of the sources files of the library (*.as, *.mxml) are newer than the SWC?

I've looked at <dependset> but it only seems to delete files, not determine whether a task should be run or not. <depend> seems to expect a one-to-one relationship between the source and target files rather than a one-to-many relationship -- I have many input files and one output file, but no intermediate object files.

Thanks a lot, Alex

© Stack Overflow or respective owner

Related posts about ant

Related posts about flex