Making an ANT Macro more reusable

Posted by 1ndivisible on Stack Overflow See other posts from Stack Overflow or by 1ndivisible
Published on 2010-05-12T17:39:42Z Indexed on 2010/05/12 17:44 UTC
Read the original article Hit count: 262

Filed under:
|
|

I have a simple macro (simplified version below). At the moment it assumes that there will be a single value for a single argument, however there might be multiple values for that argument. How can I pass in 0+ values for that argument so that the macro is usable in situations where I need to pass in 0+ values for that argument, not just a single value

<macrodef
   name="test">
   <attribute name="target.dir" />
   <attribute name="arg.value" />
      <sequential>
         <java jar="${some.jar}" dir="@{target.dir}" fork="true" failonerror="true">
            <arg value="-someargname=@{arg.value}"/>
         </java>
      </sequential>
</macrodef>

© Stack Overflow or respective owner

Related posts about ant

Related posts about macrodef