You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Robert A. (Bob) Morris" <ra...@cs.umb.edu> on 2001/08/28 03:15:29 UTC

element names accessible?

I have several different patterns of build files, each applicable to
several projects. I'd like to have to edit only the project name to
reuse the build. The way that comes to mind is to refer to the project
name with a variable, which would reduce me to two edits, one for the
project element name attribute, and one for the variable. But I wonder
if element data, e.g. the name attribute, is available without
explicitly copying it by hand in the file.

If yes, did I miss this in the documentation?

Re: element names accessible?

Posted by "Robert A. (Bob) Morris" <ra...@cs.umb.edu>.
Yep, thanks.

Conor MacNeill writes:
 > Date: Tue, 28 Aug 2001 21:00:13 +1000
 > From: "Conor MacNeill" <co...@cortexebusiness.com.au>
 > To: <an...@jakarta.apache.org>, <ra...@cs.umb.edu>
 > Subject: Re: element names accessible?
 > 
 > Bob,
 > 
 > Not sure if I understand you correctly but there is a property
 > ant.project.name
 > which contains the name of the project that is currently executing; it is
 > set in the name attribute of <project>.
 > 
 > Is that what you are after?
 > 
 > The list of properties is found in
 > docs/manual/using.html#built-in-props
 > 
 > of the current 1.4 Beta documentation.
 > 
 > Conor
 > 
 > 
 > ----- Original Message -----
 > From: "Robert A. (Bob) Morris" <ra...@cs.umb.edu>
 > To: <an...@jakarta.apache.org>
 > Sent: Tuesday, August 28, 2001 11:15 AM
 > Subject: element names accessible?
 > 
 > 
 > > I have several different patterns of build files, each applicable to
 > > several projects. I'd like to have to edit only the project name to
 > > reuse the build. The way that comes to mind is to refer to the project
 > > name with a variable, which would reduce me to two edits, one for the
 > > project element name attribute, and one for the variable. But I wonder
 > > if element data, e.g. the name attribute, is available without
 > > explicitly copying it by hand in the file.
 > >
 > > If yes, did I miss this in the documentation?
 > >
 > 
 > 

Re: element names accessible?

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Bob,

Not sure if I understand you correctly but there is a property
ant.project.name
which contains the name of the project that is currently executing; it is
set in the name attribute of <project>.

Is that what you are after?

The list of properties is found in
docs/manual/using.html#built-in-props

of the current 1.4 Beta documentation.

Conor


----- Original Message -----
From: "Robert A. (Bob) Morris" <ra...@cs.umb.edu>
To: <an...@jakarta.apache.org>
Sent: Tuesday, August 28, 2001 11:15 AM
Subject: element names accessible?


> I have several different patterns of build files, each applicable to
> several projects. I'd like to have to edit only the project name to
> reuse the build. The way that comes to mind is to refer to the project
> name with a variable, which would reduce me to two edits, one for the
> project element name attribute, and one for the variable. But I wonder
> if element data, e.g. the name attribute, is available without
> explicitly copying it by hand in the file.
>
> If yes, did I miss this in the documentation?
>