ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: strange behaviour
Date Mon, 24 Jun 2002 09:05:02 GMT
--- Dmitry Trunikov <tda@quasarlabs.com> wrote:
> I revealed strange ant's behaviour (it is only my opinion :). Suppose
> there is following build.xml:
> 
> <project default="all">
>     <target name="all" depends="task1" if="not_defined_property">
>         <echo message="In task - all."/>
>     </target>
>     <target name="task1">
>         <echo message="In task - task1."/>
>     </target>
> </project>
> 
> I ascertained that task "task1" will be done in any way, just if
> paroperty "not_defined_property" didn't defined (i.e. attribute "if" is
> resolving  _after_  resolving "depends"). I think that this behaviour is
> not right and depended task have to be done only when attribute "if" is
> true. What do people think about this situation?

The if/unless are attributes of <target>, just like 'depends' is -- they
affect whether the <target> they're specified for will be run, not whether
the target(s) specified in the 'depends' attribute will be run. In this
way, the dependent target can (and more often than not does) determine
whether the property being checked for gets set or not. Maybe if you wrote
it:
  <target name="all" if="not_defined_property" depends="task1">
it'd be more clear?

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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


Mime
View raw message