ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Cohen" <>
Subject RE: macrodef - do attributes as properties or substitutions
Date Tue, 18 Nov 2003 15:12:40 GMT

-----Original Message-----
From: [] 
Sent: Tuesday, November 18, 2003 2:06 AM
Subject: RE: macrodef - do attributes as properties or substitutions

> > <macrodef name="macro">
> >     <attribute name="one"/>
> >     <attribute name="two" default="${one}"/>
> > </macrodef>
> > <macro one="hello"/>
> I don't think we should need any special cludges just to support this 
> usecase. 8-)
> Give two a completely bogus, impossible to be used in any real world 
> usage value and check for that.  Should be easier than comparing it to 
> a literal ${one} or @one or whathever.
> <macrodef name="macro">
>     <attribute name="one"/>
>     <attribute name="two"
> default="nobody-with-a-sane-mind-would-ever-want-to-use-this-value"/>
> </macrodef>

Nice idea - usually such nice words don´t come into my mind when I´m programming :-) But
the string comparison would be easier.


I have used a similar idea with a build file full of "template" targets that use a fileset
reference.  The reference must be defined globally or the build will break, but only some
of the users of the file of "templates" actually need the reference.  So, since references
can be overridden, the solution is, similar to Stefan's, 

<fileset id="globaltlds" dir=".">
    <include name="no.real.file"/>

Later, a user of this buildfile can redefine the globaltlds reference, if it needs to, to
something real.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message