From 77068fb7e13f983d128a22d562819cd73497fed6 Mon Sep 17 00:00:00 2001
From: Peter Reilly
Date: Thu, 23 Aug 2007 08:23:05 +0000
Subject: [PATCH] bugzilla 43040: incorrect information on when tasks get
created
git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@568882 13f79535-47bb-0310-9956-ffa450edef68
---
docs/manual/develop.html | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/docs/manual/develop.html b/docs/manual/develop.html
index fd28aefa9..88ff90e8b 100644
--- a/docs/manual/develop.html
+++ b/docs/manual/develop.html
@@ -76,9 +76,18 @@ good convention, though.
The Life-cycle of a Task
- - The task gets instantiated using a no-argument constructor, at parser
- time. This means even tasks that are never executed get
- instantiated.
+ -
+ The xml element that contains the tag corresponding to the
+ task gets converted to an UnknownElement at parser time.
+ This UnknownElement gets placed in a list within a target
+ object, or recursivly within another UnknownElement.
+
+ -
+ When the target is executed, each UnknownElement is invoked
+ using an
perform()
method. This instantiates
+ the task. This means that tasks only gets
+ instantiated at run time.
+
- The task gets references to its project and location inside the
buildfile via its inherited
project
and
@@ -86,18 +95,18 @@ good convention, though.
- If the user specified an
id
attribute to this task,
the project
- registers a reference to this newly created task, at parser
+ registers a reference to this newly created task, at run
time.
- The task gets a reference to the target it belongs to via its
inherited
target
variable.
- init()
is called at parser time.
+ init()
is called at run time.
- All child elements of the XML element corresponding to this task
are created via this task's
createXXX()
methods or
instantiated and added to this task via its addXXX()
- methods, at parser time.
+ methods, at run time.
- All attributes of this task get set via their corresponding
setXXX
methods, at runtime.
@@ -109,10 +118,8 @@ good convention, though.
- All attributes of all child elements get set via their corresponding
setXXX
methods, at runtime.
- execute()
is called at runtime. While the above initialization
- steps only occur once, the execute() method may be
- called more than once, if the task is invoked more than once. For example,
- if target1
and target2
both depend
+ execute()
is called at runtime.
+ If target1
and target2
both depend
on target3
, then running
'ant target1 target2'
will run all tasks in
target3
twice.