You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Sayed, Irfan (Irfan)" <is...@avaya.com> on 2007/10/05 12:46:27 UTC
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.
Regards
Irfan.
Re: Calling another ant script
Posted by Ramu Sethu <sr...@yahoo.co.in>.
Use <antcall> task
For more info see http://ant.apache.org/manual/CoreTasks/antcall.html
On 10/5/07, Sayed, Irfan (Irfan) <is...@avaya.com> wrote:
>
> Hi All,
>
> I need to call one ant script from another ant script. Can somebody
> please tell me how to do that.
>
> Regards
> Irfan.
>
>
>
>
--
Thank you
Ramu S
If A is success in life, then A equals x plus y plus z. Work is x; y is
play; and z is keeping your mouth shut.
- Albert Einstein
Re: Calling another ant script
Posted by Ramu Sethu <sr...@yahoo.co.in>.
Sorry everybody ... made a mistake by mentioning <antcall> instead of <ant>
On 10/5/07, Alec Fernandez <Al...@sas.com> wrote:
>
> The handy, dandy ant task is the ticket. This from
> ant.apache.org/manual.
>
> <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/default.properties"/>
> </ant>
>
> <ant inheritAll="false" antfile="subproject/subbuild.xml">
> <property name="output.type" value="html"/>
> </ant>
>
> 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
> this:
>
> <path id="path1">
> ...
> </path>
> <path id="path2">
> ...
> </path>
>
> 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"/>
> </ant>
>
> will override subbuild's definition of path1.
>
> <ant antfile="subbuild.xml" inheritrefs="false">
> <reference refid="path1" torefid="path2"/>
> </ant>
>
> will copy the parent's definition of path1 into the new project using
> the id path2.
>
> -----Original Message-----
> From: Sayed, Irfan (Irfan) [mailto:isayed@avaya.com]
> 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.
>
> Regards
> Irfan.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
--
Thank you
Ramu S
If A is success in life, then A equals x plus y plus z. Work is x; y is
play; and z is keeping your mouth shut.
- Albert Einstein
RE: Calling another ant script
Posted by Alec Fernandez <Al...@sas.com>.
The handy, dandy ant task is the ticket. This from
ant.apache.org/manual.
<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/default.properties"/>
</ant>
<ant inheritAll="false" antfile="subproject/subbuild.xml">
<property name="output.type" value="html"/>
</ant>
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
this:
<path id="path1">
...
</path>
<path id="path2">
...
</path>
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"/>
</ant>
will override subbuild's definition of path1.
<ant antfile="subbuild.xml" inheritrefs="false">
<reference refid="path1" torefid="path2"/>
</ant>
will copy the parent's definition of path1 into the new project using
the id path2.
-----Original Message-----
From: Sayed, Irfan (Irfan) [mailto:isayed@avaya.com]
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.
Regards
Irfan.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org