ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Project vs Sub Project - Why such Design
Date Thu, 05 Nov 2009 05:30:04 GMT
On 2009-11-05, Raja Nagendra Kumar <> wrote:

> I see a protected method getNewProject()

> The sub project getProject() seems to give the value of parent project..

Both is inside the <ant> task?

<ant> is the task that creates the subproject (using getNewProject) and
executes the targets inside of it.  The task itself is in the calling
project and thus getProject returns the parent project (like it does for
any other task in that project as well).

For a task inside the called build file, getProject will not return the
parent but the current project.

> What is the senario

> A.xml -> calls B.xml --> c.xml

> When c.xml is called, is c the sub project of B and also A..

c is a sub project of B, yes.

> Why did ant decide to with sub project approach rather than calling each ant
> call as independent project by it self but it may have just one parent.

I don't think I understand the question.  Are you asking why c is not a
sub project of A instead of B?  Why should it?  If B.xml contains an
<ant> task invoking c.xml the build file writer of B.xml will certainly
expect that B.xml will be the parent.  B.xml could be invoked directly
from the command line rather than via an <ant> task in any other build
file after all.

> I am sure this must be having some thing to do with class loaders,
> parallelization etc..

Not at all.


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

View raw message