ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Inger <ma...@sedonacorp.com>
Subject Re: [PATCH] Added "ant.target.name" property
Date Wed, 12 Sep 2001 17:35:34 GMT
The reason you name it is that if you want to refer
to the project in javascript you have to do something like:

<project name="MyProject" ...>

...
<target name="foo">
 <script><![CDATA[
   var val = MyProject.getProperty("bar");
 ]]></script>
</target>

It is unfortunate that you have to refer to the
project this way in a script, but nevertheless,
this is the case.  So, that is one reason why you
would name a project.

I would prefer that when you script something, you
can refer to the getProject() method of the current
script task, but that's not something you can do right
now, as far as i know.


On Wed, 2001-09-12 at 13:03, Peter Janes wrote:
> Peter Donald wrote:
> 
> > So instead of
> > 
> > <project name="foo" default="..." >
> > 
> > you would have
> > 
> > <project default="..." >
> >   <property name="name" value="foo" />
> > 
> > And that works fine ;) Instead of name you could even use ant.project.name as 
> > name of property and have it fully compatible ;)
> 
> So why bother naming projects, then, if the name can't actually be used 
> anywhere?  Or is that your point?
> 
> Isn't staying out of the ant.* namespace, especially in user files, a Good 
> Thing?  Sure, it's not explicitly forbidden, but since we're talking about 
> evil programming, maybe it should be....
> 
> Peter J.
> -- 
> fix, n., v.  What one does when a problem has been reported too many
> times to be ignored.
>    --The New Hacker's Dictionary, 3rd ed.
> 
-- 
Matt Inger (matt.inger@sedonacorp.com)
Sedona Corporation
455 S. Gulph Road, Suite 300
King of Prussia, PA 19406
(484) 679-2213
"Self-respect - the secure feeling that no one,
 as yet, is suspicious." -H.L. Mencken 


Mime
View raw message