ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Fetzer <>
Subject Re: Call a Macrodef using a property?
Date Wed, 30 Dec 2009 16:49:38 GMT
Thanks Antoine.  I haven't used the script task before.  I need a little help on setup though,
do you have a link for me.  I started by getting bsf.jar in my path.  Once I got that out
there, it asked for logFactory.  I put that in my path, now it's asking for EvaluatorException. 
I'm guessing there's a simpler way to allow scripting in Ant.

Thanks Again,

From: Antoine Levy Lambert <>
To: Ant Users List <>
Sent: Wed, December 30, 2009 9:01:57 AM
Subject: Re: Call a Macrodef using a property?

Hello Eric,

you would have to embed a scripting language in ant to do this.

Something like (untested)

<script language="javascript"> <![CDATA[

      macrotask = project.createTask(macroname);

  ]]> </script>

Look at the corresponding page in the manual (under optional tasks, Script) and at the library



Eric Fetzer wrote:
> Is there any way to call a macrodef with the name of the macrodef held in a property? 
Like this (of course this doesn't work):
> <project default="main">
>  <target name="main">
>    <property name="myProperty" value="myMac"/>
>    <${myProperty}/>
>  </target>
>  <macrodef name="myMac">
>    <sequential>
>      <echo message="I made it in"/>
>    </sequential>
>  </macrodef>
> </project>

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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message