ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alec Fernandez" <>
Subject RE: Calling another ant script
Date Fri, 05 Oct 2007 10:58:42 GMT
The handy, dandy ant task is the ticket.  This from

<ant antfile="subproject/subbuild.xml" target="compile"/>

<ant dir="subproject"/>

<ant antfile="subproject/property_based_subbuild.xml">
  <property name="param1" value="version 1.x"/>
  <property file="config/subproject/"/>

<ant inheritAll="false" antfile="subproject/subbuild.xml">
  <property name="output.type" value="html"/>

These lines invoke the same build file:

<ant antfile="sub1/sub2/build.xml" />
<ant antfile="sub2/build.xml" dir="sub1" />
<ant antfile="build.xml" dir="sub1/sub2" />

The build file of the calling project defines some <path> elements like

<path id="path1">
<path id="path2">

and the called build file (subbuild.xml) also defines a <path> with the
id path1, but path2 is not defined:

<ant antfile="subbuild.xml" inheritrefs="true"/>

will not override subbuild's definition of path1, but make the parent's
definition of path2 available in the subbuild.

<ant antfile="subbuild.xml"/>

as well as

<ant antfile="subbuild.xml" inheritrefs="false"/>

will neither override path1 nor copy path2.

<ant antfile="subbuild.xml" inheritrefs="false">
  <reference refid="path1"/>

will override subbuild's definition of path1.

<ant antfile="subbuild.xml" inheritrefs="false">
  <reference refid="path1" torefid="path2"/>

will copy the parent's definition of path1 into the new project using
the id path2. 

-----Original Message-----
From: Sayed, Irfan (Irfan) [] 
Sent: Friday, October 05, 2007 6:46 AM
To: Ant Users List
Subject: Calling another ant script

Hi All,
I need to call one ant script from another ant script. Can somebody
please tell me how to do that.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message