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,
Eric




________________________________
From: Antoine Levy Lambert <[email protected]>
To: Ant Users List <[email protected]>
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[

      macroname=project.getProperty("myProperty");
      macrotask = project.createTask(macroname);
      macrotask.execute();

  ]]> </script>

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

Regards,

Antoine

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: [email protected]
For additional commands, e-mail: [email protected]


      

Reply via email to