ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: depends executed before if/unless
Date Fri, 11 Mar 2005 16:36:46 GMT
On Fri, 11 Mar 2005, Andrew Ferguson <> wrote:

> Is this a misunderstanding of the intended use of the if/unless
> attributes?

Maybe, at least what you see is correct - both your description and
from Ant's intentions.

It is a very common design pattern in build files to set the
properties used in if/unless in targets that the target in question
depends on, something like

  <target name="bake" depends="getFlour, getMilk, getYeast etc.."

  <target name="getMilk" depends="checkUserHungry,checkMilk"
          if="user.hungry" unless="have.milk"/>

Here you want the checkMilk target to get executed since it will set
have.milk (or not).


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

View raw message