ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: Re: Is it possible to "subclass" a macrodef?
Date Tue, 31 Oct 2006 05:54:18 GMT
Mmmh maybe you can ;-)
Ok, not really "subclassing" a macrodef - but reusing its implementation:
use xml entities.

build.xml
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----
<?xml version="1.0"?>
    <!DOCTYPE project [
      <!ENTITY mdOneImpl SYSTEM "mdOneImpl.xml">
    ]>


    <macrodef name="mdOne">
        <attribute name="one"/>
        <sequential>
            &mdOneImpl;
        </sequential>
    </macrodef>


    <macrodef name="mdTwoExtendsOne">
        <attribute name="one"/>
        <attribute name="two"/>
        <sequential>
            <echo>before</echo>
            &mdOneImpl;
            <echo>after</echo>
        </sequential>
    </macrodef>

</project>
---8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<-------8-<----



Ok, not tested and maybe not really useful ;-)


Jan 

>-----Urspr√ľngliche Nachricht-----
>Von: cknell@onebox.com [mailto:cknell@onebox.com] 
>Gesendet: Montag, 30. Oktober 2006 21:10
>An: user@ant.apache.org
>Betreff: RE: Re: Is it possible to "subclass" a macrodef?
>
>Thanks. I'll just re-work the existing one and put it directly 
>in the build file.
>--
>Charles Knell
>cknell@onebox.com - email
>
>
>
>-----Original Message-----
>From:     Dominique Devienne <ddevienne@gmail.com>
>Sent:     Mon, 30 Oct 2006 13:42:34 -0600
>To:       "Ant Users List" <user@ant.apache.org>
>Subject:  Re: Is it possible to "subclass" a macrodef?
>
>On 10/30/06, cknell@onebox.com <cknell@onebox.com> wrote:
>> changing nothing but making an addition to the attribute list.
>Well, you necessarily will use that new attribute in the macro body,
>so you must effectively change more than just the attribute list, no?
>
>> Can this be done
>No, AFAIK. I bet you may be able to redefine a macro, but then you
>probably have no way to reuse the old one. --DD
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message