ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: depends executed before if/unless
Date Fri, 11 Mar 2005 16:36:46 GMT
On Fri, 11 Mar 2005, Andrew Ferguson <Andrew.Ferguson@arm.com> 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.."
          if="user.hungry">

  <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).

Stefan

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


Mime
View raw message