ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xu Xin" <>
Subject how to get the configured nested tasks from Macrodef?
Date Mon, 19 Feb 2007 08:19:15 GMT
Hellow everyone,

I am working with ANT 1.6.5, have a question for MacroDef: how can I get the
configured nested tasks from <macrodef>?

suppose  I have the following macrodef template,
 <macrodef name="myjunit">
    <attribute name="test"/>

         <junit fork="false">
           <classpath refid="test.cp"/>
          <sysproperty key="color" value="red"/>
          <test name="@{test}"/>



and I have a following target:

  <target name="test">
     <myjunit test="sometest.Test1"/>

what I want is that I have a "detecting" code to search for the occurrence
of a particular macro and get the well configured (element/attribute have
been already substituted) nested task, so the above example,  I need to the
get  the identical tasks from "test" target:


         <junit fork="false">
           <classpath refid="test.cp"/>
          <sysproperty key="color" value="red"/>
          <test name="sometest.Test1"/>


I looked at the MacroInstance, it seems like all element/attribute
substitution're performed when we actually run it.

Is it possible I can still get the nested configured tasks from
MacroInstance without running it?

One more question:

If I can get the configured tasks from marodef, suppose I will change
something against them, will the changes be persisted cross multiple macro
invocation? Now, MacroInstance will likely do a copy everytime it runs.


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