ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Weintraub" <>
Subject Re: target conditional and dependency issue
Date Fri, 22 Aug 2008 17:27:43 GMT
On Fri, Aug 22, 2008 at 11:03 AM, Eric Wood <> wrote:
> I have a target that I only want to execute if a property is set, but it
> executes the dependencies regardless.

Yes, the dependencies to get hit before the test is done. There's a
reason for that:

<target name="foo"
    depends "foo-test"

<target name="foo-test">
<condition property="foo-test-passes"
     <some condition>

This allows me to run my target "foo", but only if I pass the
"foo-test". Otherwise, there would be no easy way to run a target
based upon a more complex condition than whether a particular property
is set or not.

Your work around is pretty much the way to make sure that you don't
run dependencies if the target is not suppose to be executed.

David Weintraub

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

View raw message