I saw this relevant question but my situation is different so asking this again. Basically, I have 12 ant files that I have to run in a specific sequence. For each ant file, I select a different target, such as "create" or "build and deploy all." How can I create an ant file that will call of the right targets for all of these files?
Pseudocode:
<Call antFile1, "clean">
<Call antFile1, "create">
<Call antFile2, "build">
.
.
.
<Call antfile12, "build and deploy all">
Maybe have a target like below in encompassing ant file:
Refer here: http://ant.apache.org/manual/Tasks/ant.html
You can also have import tags:
And then you can call the ant targets in that file. You may want to qualify (add a prefix to) your target names to avoid ambiguity if you do that.
EDIT: Calling the ant targets from the imported file is exactly the same as calling local targets:
You can also use them as dependencies:
Think of it the same way as importing in any programming language. Once it's imported you can use it as-if it were just another target in your file.
Here is the import documentation.