ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: property visibility confusion
Date Thu, 22 Jan 2004 19:27:07 GMT
> From: Doug Lochart [mailto:dlochart@capecomputing.com]

> I guess I am still in the "method calling mode" of Java.
> I did not think it was that big of a difference between the antcall and
> the depends but since you say its faster and uses the same project then
> I will strive to take that approach.

It is indeed the recommended way, at least I recommend it ;-)

Actually, you're using Ant-Contrib's <if>, but the pure Ant way
aquivalent of:

<target ...>
  <if>
    ... some condition testing ant code
    <then>
      ... do something
    </then>
  </if>
  ... do something else
</target>

is:

<target ... depends="do-something">
  ... do something else
</target>

<target name="do-something" depends="do-something?"
        if="do-something-property">
  ... do something
</target>

<target name="do-something?" >
  <condition property="do-something-property">
    ... some condition testing ant code
  </condition>
</target>

targets listed in the depends attribute are run before evaluating the
if/unless condition. This is just an FYI. I use both techniques, depending
on the weather and whether a dependency on Ant-Contrib is OK ;-) --DD

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


Mime
View raw message