Thank you Stefan for providing the insites..

I complete see the point related to 
> <ant> tasks and maybe even <parallel>.

Based on lifecycle link you provided I see that there is a mention of 
> The task gets references to its project and location inside the buildfile
> via its inherited project and location variables. 

In such cases, why should the user initialise them explicitly, when run from
build file.

Pl. suggest any other better approach, so that, when the user does not
explicitly intialise the task, it could take parents project and other info
related to parent.

If you could provide me details on the classes to look for this, I shall try
providing fix based on that understanding.

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com






Stefan Bodewig wrote:
> 
> On 2008-12-11, Raja Nagendra Kumar <[EMAIL PROTECTED]> wrote:
> 
>> Pl. find the fix for the same in ProjectComponent
> 
>> We are defining a GOBAL_DEFAULT_PROJECT which would be same as the first
>> non
>> null setProject call parameter.
> 
> That would be a pretty bad idea, in particular in the presence of
> <ant> tasks and maybe even <parallel>.
> 
> Generally Ant's API is not designed to be used in an embedded way and
> if you create any sort of task programatically you better make sure it
> is initialized properly, which includes setting the project instance.
> 
> If you create a task programatically, make sure you implement the full
> lifecycles as defined
> <http://ant.apache.org/manual/develop.html#writingowntask> because the
> existing task will depend on it.
> 
> I don't see you method setting the location, owning target or invoking
> init() either, which might get you in trouble as well.
> 
> You may want to use Task.bindToOwner() to copy the most important
> properties from your current task to the manualy created copy task but
> should still invoke init() (some tasks use it, Copy does not).
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/FileSet-with-copy-fails-with-NPE..-tp20935877p20951371.html
Sent from the Ant - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to