Author: peterreilly Date: Thu Aug 23 01:23:19 2007 New Revision: 568883 URL: http://svn.apache.org/viewvc?rev=568883&view=rev Log: sync: bugzilla 43040: incorrect information on when tasks get created
Modified: ant/core/branches/ANT_17_BRANCH/docs/manual/develop.html Modified: ant/core/branches/ANT_17_BRANCH/docs/manual/develop.html URL: http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/docs/manual/develop.html?rev=568883&r1=568882&r2=568883&view=diff ============================================================================== --- ant/core/branches/ANT_17_BRANCH/docs/manual/develop.html (original) +++ ant/core/branches/ANT_17_BRANCH/docs/manual/develop.html Thu Aug 23 01:23:19 2007 @@ -76,9 +76,18 @@ <h3>The Life-cycle of a Task</h3> <ol> - <li>The task gets instantiated using a no-argument constructor, at parser - time. This means even tasks that are never executed get - instantiated.</li> + <li> + 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. + </li> + <li> + When the target is executed, each UnknownElement is invoked + using an <code>perform()</code> method. This instantiates + the task. This means that tasks only gets + instantiated at run time. + </li> <li>The task gets references to its project and location inside the buildfile via its inherited <code>project</code> and @@ -86,18 +95,18 @@ <li>If the user specified an <code>id</code> 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.</li> <li>The task gets a reference to the target it belongs to via its inherited <code>target</code> variable.</li> - <li><code>init()</code> is called at parser time.</li> + <li><code>init()</code> is called at run time.</li> <li>All child elements of the XML element corresponding to this task are created via this task's <code>createXXX()</code> methods or instantiated and added to this task via its <code>addXXX()</code> - methods, at parser time.</li> + methods, at run time.</li> <li>All attributes of this task get set via their corresponding <code>setXXX</code> methods, at runtime.</li> @@ -109,10 +118,8 @@ <li>All attributes of all child elements get set via their corresponding <code>setXXX</code> methods, at runtime.</li> - <li><a name="execute"><code>execute()</code></a> 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 <code>target1</code> and <code>target2</code> both depend + <li><a name="execute"><code>execute()</code></a> is called at runtime. + If <code>target1</code> and <code>target2</code> both depend on <code>target3</code>, then running <code>'ant target1 target2'</code> will run all tasks in <code>target3</code> twice.</li> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]