I have an existing Ant project and would like to speed up the build process by avoiding reassembling components that have already been updated.
Ant allows you to specify that one target depends on another, but by default all prerequisites are always rebuilt, even if it is already Date. (This is the key difference between Ant and make. By default, make only restores the target if necessary โ that is, if some precondition is higher.)
<uptodate property="mytarget.uptodate"> // in set.mytarget.uptodate task
...
</uptodate>
<target name="mytarget" depends="set.mytarget.uptodate" unless="mytarget.uptodate">
...
</target>
To make Ant rebuild the preconditions only when necessary, there seem to be two common approaches in Ant.
The first approach is to use the task uptodateto set the property. Then, your task can check the property and build only if the property is (not) set.
<uptodate property="mytarget.uptodate"> // in set.mytarget.uptodate task
...
</uptodate>
<target name="mytarget" depends="set.mytarget.uptodate" unless="mytarget.uptodate">
...
</target>
outofdate Ant contrib.
, ,
; , forofdate
.
<fileset> <modified>
. MD5 , MD5
.
<param name="cache.cachefile" value="cache.properties"/>
; "cache.properties".
, src dest,
:
<copy todir="dest">
<fileset dir="src">
<modified/>
</fileset>
</copy>
, Ant
( ), .
, ,
. Ivy, -,
,
. Maven
, , .
( Maven, , ;
, Maven .)
?