|Building Dependent targets|
Building Dependent targets 2007-05-24 - By David Weintraub
Ant will show the task as being executed, but may not actually carry
out the task. For example, you may see a task <copy> being executed
when you have the debug flag on, but the copy itself might not be
done. Of course, a target will always be executed even if the tasks in
it don't have to be executed.
Some tasks (due to the way the task was programmed) will execute even
if it doesn't have to. For example, in old Weblogic bean creations,
the bean would be recreated even if the *.java files weren't modified.
To get around this problem look at the "uptodate" task. This task
allows you to set a property if a particular set of files have a
timestamp that's newer than a particular source file. Then, you can
define a target to run if the property is set or not set.
If you use the Ant Contrib tasks, you can use the "outofdate" task
which is very similar to the "uptodate" task, except that the
"outofdate" task allows you to define a set of tasks to execute when
the outofdate condition is met. These tasks can be run either
sequentially or in parallel.
for information on the outofdate task and
<http://ant.apache.org/manual/CoreTasks/uptodate.html> for the
"uptodate" task. Remember that the "outofdate" task is only good if
you have the antcontrib tasks included in your task library.
On 24 May 2007 11:46:03 -0000, query <search2006@(protected)> wrote:
> Earlier I was using some other build tool to build my project. Here if a
target is built and if the same target is used to build some other target, it
compares the timestamp and will not build the dependent targets again.
> As I started working on ANT, I found it very useful and intersting. But in
ANT, while building each target, it will try to build all the dependent targets
that many times as it occurs in different targets. As a result it is increasing
project\'s build time.Is there any task to ensure that the dependent targets
once built will not be built again ????
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)