Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loop over property in Ant

Tags:

ant

I would like to understand that is the following possible in Ant

  • Read a property eg : ${for.loop.condition}

  • Based on the above property value , create a for loop

  • And loop dynamically create a string from that value

I have read on the ant-contrib task , but not so sure whether that would help me out.

Any examples would help me

like image 873
Vivek Avatar asked Aug 27 '12 07:08

Vivek


1 Answers

You can use a variable where a list of values are concatenated to control the iteration, so you can decide what to do with each value. Check this post it may help you to use the "for" tag.

You can also use the for-each tag to iterate through a set of values selected with a fileset tag.

<foreach target="target2Call" param="paramName">
   <fileset dir="${myDir}">
       <include name="**/mifilesFilter.*" />
   </fileset>
</foreach>

Here's another example about how to use foreach tag.

like image 188
kothvandir Avatar answered Oct 28 '22 13:10

kothvandir