ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AirTraffic <>
Subject How can I call a macro instance from a script task
Date Thu, 04 Sep 2008 20:58:52 GMT

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"/ > 
<echo>macro called with host '${host}'</echo> 
</macrodef > 

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

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

Any help would be appreciated!
View this message in context:
Sent from the Ant - Users mailing list archive at

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

View raw message