views:

59

answers:

1

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>
A: 

Turns out you can do this one of two ways. Either you can pass in collections such as fileset as attributes then reference them as needed, or you can pass in collections as elements and reference them using the element name.

1ndivisible