You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jay Glanville <di...@nortelnetworks.com> on 2000/10/31 19:24:40 UTC

why can references only be defined at the target level?

Boy, when your subject line says it all ...

Basically, I'd like to have an "initialize" target, and in that target,
define some of the common variables (pops, references) that all the other
targets will be using.  However, all references have to be defined at the
target level (i.e.: they can't be defined within a target).  Any particular
reason for this?

Thanx

Jay

----------------------------------------------------------------------------
-----
Jay Dickon Glanville
P068 - SiteManager Development, Nortel Networks
613-765-1144 (ESN 395-1144)
MS: 045/55/A05
E-Mail: dickon@nortelnetworks.com


Re: why can references only be defined at the target level?

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "JG" == Jay Glanville <di...@nortelnetworks.com> writes:

 JG> Boy, when your subject line says it all ...

So I have less to quote 8-)

Basically the concept of references in Ant is supposed to be used just
like the one in XML. Each element in XML can have an attribute of the
ID type (this attribute has the name id in Ant build files) which has
one special property, it has to be unique in the document. 

So if references have to be unique - viewed from the document, not the
way Ant parses the document - they are global in scope by
definition. Putting them into targets would make them look something
different (just like putting <property> tags into targets led to very
counterintuitive situations in Ant 1.1).

Stefan

Re: why can references only be defined at the target level?

Posted by James Duncan Davidson <du...@x180.com>.
On 10/31/00 10:24 AM, "Jay Glanville" <di...@nortelnetworks.com> wrote:

> Boy, when your subject line says it all ...
> 
> Basically, I'd like to have an "initialize" target, and in that target,
> define some of the common variables (pops, references) that all the other
> targets will be using.  However, all references have to be defined at the
> target level (i.e.: they can't be defined within a target).  Any particular
> reason for this?

Properties that are global (which they all should be imnsho) should be
defined at the leaf of the project, and not at any lower level. There's
nothing, however, wrong with having tasks in an initialization target
manipulate the global property collection.

-- 
James Duncan Davidson                                        duncan@x180.com
                                                                  !try; do()