ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Weintraub" <qazw...@gmail.com>
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 <EWood@llbean.com> 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"
    if='foo-test-passes"/>

<target name="foo-test">
<condition property="foo-test-passes"
     <some condition>
</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
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message