ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Ferguson" <>
Subject depends executed before if/unless
Date Fri, 11 Mar 2005 16:23:47 GMT
 I've come across what seems to be quite a deep problem with my
understanding of ANT. When you declare a target is both conditional, and
that it has dependencies, the dependencies are executed first, and then
the condition is evaluated. So
    <target name="bake" depends="getFlour, getMilk, getYeast etc.."
will go to all of the trouble of setting up the baking equipment even if
the user is not hungry. 
The workaround seems to be to create a wrapper target
    <target name="bake-wrapper" if="user.hungry">
        <antcall target="bake">
or to locate and alter each of the dependent targets of "bake" and
duplicate the conditional on them.
Is this a misunderstanding of the intended use of the if/unless
any help appreciated,
This e-mail message is intended for the addressee(s) only and may
contain information that is the property of, and/or subject to a
confidentiality agreement between the intended recipient(s), their
organisation and/or the ARM Group of Companies. If you are not an
intended recipient of this e-mail message, you should not read, copy,
forward or otherwise distribute or further disclose the information in
it; misuse of the contents of this e-mail message may violate various
laws in your state, country or jurisdiction. If you have received this
e-mail message in error, please contact the originator of this e-mail
message via e-mail and delete all copies of this message from your
computer or network, thank you.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message