ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: Project vs Sub Project - Why such Design
Date Thu, 05 Nov 2009 13:22:01 GMT
On 2009-11-05, Raja Nagendra Kumar <Nagendra.Raja@tejasoft.com> wrote:

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

> Stefan, we are using Ant class with in a custom task and see that
> getProject() is returning the parents context.

No, the context of the Ant task (which is a task inside the "parent
project", not the subproject).

This is the expected behavior.

> //due to few internal initalisations with in execute some where getProject()
> may be changing so that subproject would see getNewproject() value..

No, tasks inside the build file called by the Ant task will see the new
project, the Ant task itself is not part of that new project and never
becomes part of it.

> Trying to understand why subproject was introduced with Ant.java.. it would
> have very well been a new independent project it self. What are we gaining
> as subproject and keeping its relation with parent project.

It is a new Project instance, I'm not really sure what kind of relation
you see that is causing any harm.

One thing that would be useful would be to fork a completely separate
Java VM for the subbuild but this comes with a lot of other problems
(sharing of BuildListeners or references is not possible for example).

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message