I have a set of databases that are built using scripts that are run using Ant.
I have the scripts for each database in a separate directory.
root (build.xml)
- db1 (build.xml, *.sql)
- db2 (build.xml, *.sql)
...
The root build.xml has a target
<target name="all">
<ant dir="db1"/>
<ant dir="db2"/>
...
</target>
The build.xml in each of the subfolders is essentially the same but for the database name.
Is there a way to refactor this to one single build file that runs the sql scripts in each of the folders against the corresponding databases?
Have a look at the
subanttask. The examples in the docs show how it can be used to iteratively invoke Ant builds in subdirectories.