Choosing the Ant <modify> selector for proper operation
I have a goal in ANT that is to run the compiler on a given set of files twice: once for debugging, once for production. I only want to run the compiler if the source file has changed, so I configured the <modified> selector. However, since I need the debug and prod task to execute the given modified file, I set the update property to false on the first run. I have something like:
<!-- Do the debug build --> <apply executable="compiler"> <fileset dir="${js.src.dir}" includes="*.js"> <!-- don't update the cache so the prod build below works --> <modified update="false" seldirs="true" cache="propertyfile" algorithm="digest" comparator="equal"> <param name="cache.cachefile" value="cache.properties"/> <param name="algorithm.algorithm" value="md5"/> </modified> </fileset> <args for debug build/> </apply> <!-- Do the production build --> <apply executable="compiler"> <fileset dir="${js.src.dir}" includes="*.js"> <modified update="true" seldirs="true" cache="propertyfile" algorithm="digest" comparator="equal"> <param name="cache.cachefile" value="cache.properties"/> <param name="algorithm.algorithm" value="md5"/> </modified> </fileset> <args for prod build/> </apply> However, this does not work. My first call to the compiler still completes the cache update, and the second call is skipped. What am I missing here?
UPDATE . I ran into a problem using the <depend> selector, but still curious how to do the same with <modified>
The update is interrupted to 1.8.0:
https://issues.apache.org/bugzilla/show_bug.cgi?id=32597
Only fixed 5 years!