The ant task runs a specified build file. You have the option of specifying the build file name or just the directory. (The application uses the file build.xml in the directory specified by the dir attribute.) You can also specify a target that you want to execute. If you do not specify a target, the application uses the default target. Any properties that you set in the called project are available to the nested build file.
Here are some examples. First, to call a build file from the current build file and pass a property:<ant antfile="./hello/build.xml">
<property name="production" value="true"/>
</ant>
<ant dir="./hello"/>
Finally, to call a build file from the current build file and specify the run target that you want to execute (if the run target is not the default target, it will be executed anyway):
<ant antfile="./hello/build.xml" target="run"/>