ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 34569] New: - add a new task named "macrocall"
Date Fri, 22 Apr 2005 09:58:12 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34569>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34569

           Summary: add a new task named "macrocall"
           Product: Ant
           Version: 1.6.2
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Other
        AssignedTo: dev@ant.apache.org
        ReportedBy: yanjun.tang@citigroup.com


I have define several macro like:

<macrodef name="test1" >
    <attribute name="moduleName" />
    <sequential>
        <!-- do some things for test1 -->
    </sequential>
</macrodef>

<macrodef name="test2" >
    <attribute name="moduleName" />
    <sequential>
        <!-- do some things for test2 -->
    </sequential>
</macrodef>

<macrodef name="test3" >
    <attribute name="moduleName" />
    <sequential>
        <!-- do some things for test3 -->
    </sequential>
</macrodef>

Now I define other macro named "caller"

<macrodef name="caller" >
    <attribute name="moduleName" />
    <attribute name="version" />
    <sequential>
        <macrocall macro="test@{version}" >
            <param name="moduleName" value="@{moduleName}" />
        </macrocall>
    </sequential>
</macrodef>

As you see, I want to call different macro depend on the different value of 
version. But I don't want to hardcode like : (task "if" is a user-defined task 
by me)
    <if condition="@{version}=='1'" >
         <test1 moduleName="@{moduleName}" />
    <if>
    <if condition="@{version}=='2'" >
         <test2 moduleName="@{moduleName}" />
    <if>
    <if condition="@{version}=='3'" >
         <test3 moduleName="@{moduleName}" />
    <if>
Because this don't have expansibility. e.g. iIf I define a new macro 
named "test4", I must modify the macro "caller". I'd like "caller" can decide 
it automated.

I read the source code of task "callTarget", but I can't find some helpful 
information. I want to build a "UnknownElement" object to solve this problem, 
but I meet some difficulty.

Could you give some advice or a example?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message