ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Jan.Mate...@rzf.fin-nrw.de>
Subject AW: how to call macros dynamically?
Date Tue, 06 Jun 2006 13:13:20 GMT
Only a "hint" ;-)

<macrodef> must store a reference somewhere (I think in Project). Have a look at the
source where the reference is stored and how to access that storage.
I think you should also know the type which is registered for doing the typecast when accessing
the reference. adder/setter of that type (your configuration)?

Also have a look how to contribute tasks ;-)


Jan 

>-----Urspr√ľngliche Nachricht-----
>Von: Wolfgang Häfelinger [mailto:whaefelinger@epo.org] 
>Gesendet: Dienstag, 6. Juni 2006 15:02
>An: dev@ant.apache.org
>Betreff: how to call macros dynamically?
>
>Hi,
>
>I wonder how  to  implement a task (in Java) allowing me to 
>execute a macro. I tried to understand how it works looking 
>into Ant's source code, but I'm bit lost. Would be kind if 
>someone could give me a "roadmap" how to do it ..
>
>What I'm looking for is something like ..
>
>Assume I have a macro:
>
><macrodef name="x">
>  <attribute name="a" default="hello" />
>  ..
> </macrodef>
>
>Then I want to be able to say
>
>   <run-macro name="x" />
>
>instead of 
>
> <x/>
>
>For the beginning I'm happy to call a macro without any 
>parameters like shown. Even better would be to be able to 
>provide parameters as well:
>
> <run-macro name="x" a="hello, world" />    <!-- utopia -->
>
> <run-macro name="x">
>   <param name="a" value="hello, world" />  </run-macro>
>
>Any hints?
>
>Cheers,
>Wolfgang.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For 
>additional commands, e-mail: dev-help@ant.apache.org
>
>

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


Mime
View raw message