ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexey Solofnenko <>
Subject Problem: ANT and continuous developers build process
Date Tue, 28 May 2002 17:21:30 GMT

  In my latest project we use both MAKE and ANT. We found that ANT can more
reliable compile java classes, create archives and even faster then OS
delete files (especially if there is antivirus active and the files on a
dynamic ClearCase view). However there is one feature of MAKE that can leave
ANT only for small task execution – it is very simple to make MAKE work well
with development build. Let me explain – people, especially during
development, usually do not build their project from scratch – they change
something, compile, then change something else, then compile again, and,
usually, to make the build system more reliable, the build makes more than
it is required. Lets look, for example, at “installation image” target. The
target usually includes wiping the whole image directory (because we do not
want to install obsolete files) and then recreating it. But it should be
executed only if one of “compile” targets were executed and something was
actually “compiled” and not just in the current build, but in any build made
after the previous image was created! Unfortunately it is very difficult to
do it in ANT. In MAKE it can be done easily by converting all PHONY targets
into real ones, specifying their real dependencies (not just other ex-PHONY
targets) and adding “touch” at the end. No double maintenance, no hassle. In
ANT all targets are “PHONY”. Tasks deal with dependencies themselves, but
they do not report if anything was changed. 

  That means we have to use double target sets - recursive and non recursive

<target name="install-image-only"/>
<target name="install-image"

but this is a bad idea, because "theoretically" ANT does not guarantee that
classes target will be executed before install-image-only (and there will be
a problem in parallel ANT). The only way to fix it is to use <ant> or
<antcall>, but they do not check what targets were executed already. Too
much trouble...

  So, why not to create a set of special properties like
${build.timestamps.install-image} (to indicate when at least one file was
modified during the target execution), make them automatically persistent
and add special attributes to targets like:

<target name="install-image" depends="..."


<target name="install-image" depends="..." if-dependencies-updated="!ALL!"/>

  Alexey Solofnenko.

{   } Alexey N. Solofnenko
{ } Inventigo LLC
Pleasant Hill, CA (GMT-8 usually)

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message