0
votes

I have a directory with a list of property files for different environment(DEV/STG/QA etc.,)

I want to call an Ant target in a loop with each of this file. How do I do this. I downloaded ant-contrib and tried using the foreach but I couldn't find any example where I can read property files one at a time and call the target. Any suggestions?

I have been looking at a lot of samples on this site and online, nothing seem to match my requirement.

1

1 Answers

0
votes

As per apacche documentation : https://ant.apache.org/manual/Tasks/property.html

 <property file="foo.properties"/>

reads a set of properties from a file called "foo.properties".

so, if you have my.var=25 , then ${my.var} will get you its value 25. For your requirement you can iterate through the files based on 'env' name & do required tasks.