How to distribute each element of a list to argument of a task Ant?

前端 未结 1 1525
你的背包
你的背包 2021-01-13 12:50

How to take the values of argument for a defined task into a list (of values) without to have to rewrite the task for each value of argument ?

Example: I want to avo

相关标签:
1条回答
  • 2021-01-13 13:24

    You could use the MacroDef task to abstract the common part of your task:

    <macrodef name="myMacro">
        <attribute name="value"/>
        <sequential>
             <exec executable="cmd">
                 <arg value="/c"/>
                 <arg value="@{value}"/>
             </exec>
        </sequential>
    </macrodef>
    
    <myMacro value="value 1"/>
    <myMacro value="value 2"/>
    <myMacro value="value 3"/>
    
    0 讨论(0)
提交回复
热议问题