Java Mailing List Archive

http://www.ant-tasks.com/

Home » Ant Users List »

How can I call a macro instance from a script task

AirTraffic

2008-09-04

Replies: Find Java Web Hosting

Author LoginPost Reply

I know somebody already asked this question a few years ago, but I couldn't
find the answer, so try again


I use Ant 1.6.5
<project name= "test">
<macrodef name= "my-macro">
<attribute name= "host"/ >
<sequential>
<echo>macro called with host '${host}'</echo>
</sequential>
</macrodef >

<target name= "test">
<script language= "..."><![CDATA[
newTask = project.createTask("my-macro");
newTask.setDynamicAttribute( "host", "bingo");
newTask.execute();
]] ></script>
</target>
</project >

This returns:
org.mozilla.javascript.EcmaError: TypeError: Cannot call method
"setDynamicAttribute" of null

Any help would be appreciated!
--
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.