AntCall Task
Call another target within the same buildfile optionally specifying some properties.
<target name="default"> <antcall target="doSomethingElse"> <param name="param1" value="value"/> </antcall> </target>Ant antfile
Call target in another file.
<ant antfile="${liteLucene-project-basedir}/shrink-solr.xml" target="shrink"> <property name="original.home" value="${main-build-path}\${application-name}" /> <property name="shrinked.home" value="${main-build-path}\shrinked-${application-name}" /> <property name="shrinked.tmp" value="${main-build-path}\shrinked-tmp" /> </ant>Ant Include
Include another build file into the current project.
<include file="${parent-project-build-imp-xml}" as="parent"/> <target name="package" depends="parent.init, parent.build-package, overwrite-solr-home, create-template, parent.post-clean"/>How is <import> different from <include>?
The short version: Use import if you intend to override a target, otherwise use include.
Subant Task
Calls a given target for all defined sub-builds.
Example-Solr's build file:
<target name="compile" description="Compile Lucene and Solr"> <sequential> <subant target="compile" inheritall="false" failonerror="true"> <fileset dir="lucene" includes="build.xml" /> <fileset dir="solr" includes="build.xml" /> </subant> </sequential> </target>