> From: Stefan Bodewig [mailto:[EMAIL PROTECTED] 
> 
> On Wed, 12 Nov 2003, Jose Alberto Fernandez 
> <[EMAIL PROTECTED]> wrote:
> 
> > From: Stefan Bodewig [mailto:[EMAIL PROTECTED]
> >
> >> In which situation would "<atributes> modify properties" have
> >> negative effects on what you are planing to do with 
> >> <macrodef>?  Do you have an enlightening example?
> 
> [attribute is called debug and would shadow a debug property]
> 
> > <presetdef name="my.javac">
> >    <javac srcdir="src" destdir="classes"
> >            deprecation="${deprecation}" debug="${debug}"/> 
> > </presetdef>
> 
> I'd expect that the properties have been expanded at the 
> point of <presetdef> already so there shouldn't be any shadow 
> affecting that definition.
> 

I knew something like this will be in the answer ;-/
But never mind, my only point here is that the user of <my.javac>
will not see the connection between the attribute and
the behavior of the task. You cound achive the same example
by having:

<macrodef name="my.javac">
  <element name="fileset"/>
  <sequential>
   <javac srcdir="src" destdir="classes"
          deprecation="${deprecation}" debug="${debug}"> 
     <fileset/>
   </javac>
  </sequential>
</macrodef>

So here the properties should be expanded at execution time.
And my comments are the same. They also apply to java tasks
that use properties internally.

None of our container tasks have such behavior. For example
when I write:

   <parallel failonany="true">
     <echo>${failonany}</echo>
   <parallel>

there is no expectation that a property called "failonany" will show up
just because I use an attribute of that name. But if parallel was
implemented using a macro, then you get this behavior.
So now, when you use some code from some antlib somewhere, or you import
some build fragment. Now you need to be aware of whether the task
you want to use was an actual java task (that does not messup your
properties) or is some macro-defined task that will mess up your
properties with the names of all the attributes that you pass and
the names of any other attributes of any other macros that that macro
calls before it calls your elements.

Who will understand what is going on on a large project?

It will be just a mess with no benefit what so ever.

Is my hyperbole compelling enough? :-)

Jose Alberto
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to