If you invoke multiple targets on the command line, each target will
execute, and dependencies will execute independently. There is no way
of Ant to know if one of the targets you put on the command line might
affect a later target. For example:

$ ant first clean_first second

If Ant kept track of targets already executed, it would be messed up
by the "clean_first" target. Target "second" depends upon "first", but
"clean_first" destroyed what files "first" had built. That's why each
target will execute all of its dependencies.

However, this works fine:

<project name="test">
<target name="first"/>
<target name="second" depends="first"/>
<target name="third" depends="first,second"/>
</project>

Executing:

$ ant third
[first]
[second]
[third]

Executes target "first" only a single time

On Nov 12, 2007 12:32 PM, broken connection <[EMAIL PROTECTED]> wrote:
> Hi Friends,
> As far as I knew, if we have "depends" in the target then that target
> would run only once. But my target is running multiple times.
>
> For example, I have this:
>
> <target name="targetA">
> </target>
>
> <target name="targetB" depends="targetA">
> </target>
>
> The execution results as:
> targetA
> targetA
> targetB
>
> But I thought since "targetA" has already been executed it should show up as:
>
> targetA
> targetB
>
> And only if targetA has not been executed before, then "targetB"
> should execute "targetA" i.e again the same output
>
> targetA
> targetB
>
> Please help me guys as to where my understanding is wrong.
>
> Thanks
> Mick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



-- 
--
David Weintraub
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to