ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: Property element of ant task needs an "if"
Date Fri, 12 Jul 2002 01:47:49 GMT
--- Scott Ellsworth <scott@alodar.com> wrote:
> As an alternative, if we had a nested "inheritproperty" element that 
> forwarded just the property named, I could accomplish this end.

But that wouldn't really be the same as your proposed if/unless addition,
would it? If it's just passing the named property, then it's not allowing
for it to take on a new value, as it did in your if/unless example, where
you explicitly set the value to "orange". Also, you should keep in mind,
when dealing with this stuff, that there's the whole
anything-defined-on-the-command-line thing...

If you are going to try and do an <inheritproperty> element, you may want
to consider adding a <propertyset> datatype, so you wouldn't have to list
all the same properties to pass every time.

In the meantime, you can always just fall back on the <if> task:
  <target name="juice">
    <if>
      <isset property="juice"/>
      <then>
        <ant antfile="blend.xml" target="blendit" inheritall="false">
          <property name="juice" value="orange"/>
        </ant>
      </then>
      <else>
        <ant antfile="blend.xml" target="blendit" inheritall="false"/>
      </else>
    </if>
  </target>

A bit long-winded, but it does get you there.

Diane

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



__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.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