Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create an ant file to run other ant files

Tags:

ant

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">
like image 770
TookTheRook Avatar asked Jun 13 '11 20:06

TookTheRook


People also ask

How do I run an Ant file?

To run the ant build file, open up command prompt and navigate to the folder, where the build. xml resides, and then type ant info. You could also type ant instead. Both will work,because info is the default target in the build file.


1 Answers

Maybe have a target like below in encompassing ant file:

<target name="all">
     <ant antfile="antFile1" target="clean" />
     <ant antfile="antFile2" target="create" />
     ...
</target>

Refer here: http://ant.apache.org/manual/Tasks/ant.html

like image 83
manojlds Avatar answered Oct 26 '22 14:10

manojlds