ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vishal Vishnoi <vvish...@bea.com>
Subject [Fwd: how to get the configured nested tasks from Macrodef?]
Date Wed, 21 Feb 2007 18:17:54 GMT
Can someone from Ant's dev team respond to this.

Thanks,

--Vishal

-------- Original Message --------
Subject: 	how to get the configured nested tasks from Macrodef?
Date: 	Mon, 19 Feb 2007 16:19:15 +0800
From: 	Xu Xin <anfernee.xu@gmail.com>
Reply-To: 	Ant Users List <user@ant.apache.org>
To: 	user@ant.apache.org



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"/>
    <sequential>

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

        </junit>

    </sequential>
 </macrodef>

and I have a following target:

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

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:

    <sequential>

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

    </sequential>

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.


-- 
anfernee


_______________________________________________________________________
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.

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