You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jason Rosenberg <ja...@squaretrade.com> on 2000/11/29 08:02:02 UTC

do refids and properties in sub-projects persist in main probject?

If from a main project, I call a sub-project via the 'ant' task,
and in that subproject I define properties and refids, etc.,
will the calling project then know about them?

I am trying to find a way to initialize things in a standard
way for all my projects, by calling a common init sub-project.

Is this a good way to do this, or is there a better way?

For instance, I need a good way to initialize the classpath, etc.

I am trying to use a single properties file, which defines things
like JAVA_HOME, etc.

Jason

Re: do refids and properties in sub-projects persist in main probject?

Posted by Stefan Bodewig <bo...@apache.org>.
Jason Rosenberg <ja...@squaretrade.com> wrote:

> If from a main project, I call a sub-project via the 'ant' task,
> and in that subproject I define properties and refids, etc.,
> will the calling project then know about them?

No. Properties flow from the calling project to the called project but
not vice versa, references are not copied over at all.

> I am trying to find a way to initialize things in a standard
> way for all my projects, by calling a common init sub-project.

I'd suggest to use SYSTEM entities and "include" a common XML snippet,
see <http://marc.theaimsgroup.com/?l=ant-user&m=97375741511783&w=2>
for an example (it is in the FAQ as well, but hasn't been approved
yet).

> I am trying to use a single properties file, which defines things
> like JAVA_HOME, etc.

JAVA_HOME needs to be an environment variable, you cannot set it as a
property.

Stefan