I would advise taking a look at the Uptodate task. I have never used it before, but I think that what you are trying to do will be implemented in the following lines:
<target name="libs"/> <uptodate property="isUpToDate"> <srcfiles dir="${source.dir}" includes="**/*.jar"/> <globmapper from="${source.dir}/*.jar" to="${destination.dir}/*.jar"/> </uptodate> <antcall target="copy_libs"/> <antcall target="clean_compiled_classes"/> </target> <target name="copy_libs" unless="isUpToDate"> <copy file=... /> <copy file=... /> <copy file=... /> </target> <target name="clean_compiled_classes" unless="isUpToDate"> <delete .../> </target>
Another option is to implement your own ant task, which will do what you want. This will require a little more work.
source share