ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Weintraub" <>
Subject Re: calling ANT or Depends?
Date Wed, 25 Jun 2008 21:06:09 GMT
Are you putting <ant> calls into your build.xml to call your targets?

You should have something like this:

<target name="init">

<target name="clean">

<target name="compile"

<target name="sendReport"

<target name="complete"
   depends="clean sendReport"/>

Running "ant complete" will run "init", "clean", "compile", and
"sendReport" only once. If you call multiple targets on the command
line, or use <ant> tasks, you will get multiple calls because each
target is executed separately.

Note that I only "complete" depending upon "clean". You usually don't
force a "clean" or you break your build dependency checking.

Here's my test build.xml:

<project name="test" default="complete" basedir=".">
    <target name="init"/>
    <target name="clean"/>
    <target name="compile" depends="clean,init"/>
    <target name="sendReport" depends="init,compile"/>
    <target name="complete" depends="init,sendReport"/>

Try running "ant compile", "ant sendReport" and "ant complete".

David Weintraub

On Wed, Jun 25, 2008 at 9:38 AM, Guy Catz <> wrote:
> I want to run the most trivial build process -
> init, and - clean, compile, sendReport which depend on init.
> Now, I've wrote a MAIN target -
> <target name="MAIN">
>    <ant ...     clean />
>    <ant ...     compile />
>    <if result is ok, then prepare something>
>    <ant ...     sendReport />
> </target>
> The problem - init is being called three times.
> I know that the best way to do it is <target name="main" depends="init, clean, compile,
sendReport" />
> but the problem is that I have to do something between the compile and the sendReport
> how can I accomplish this?
> Please advise.
> Thanks,
>    Guy.

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

View raw message