ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: Better property handling...
Date Mon, 11 Feb 2002 19:07:59 GMT
--- Dominique Devienne <> wrote:
> On the other hand, when the condition is false, I get
> awregister.manifest-up2date = ${awregister.manifest-up2date}
> Ideally, I would like to see false instead of
> ${awregister.manifest-up2date}! 
> Any way to do that cleanly?

The problem is, if you're using your "awregister.manifest-up2date"
property for if/unless in other targets (which I assume you are), you
can't set it literally to 'false', because if/unless only check for
set/not-set, so you'd get bad results that way (since it would always be
set to something). You'll need to set a property to use just for the echo
value. Eg:
  <target name="awregister.manifest-up2date?">
    <condition property="awregister.manifest-up2date">
        <available property="classes-dir-exists"
                   type="dir" />
        <uptodate targetfile="${awregistration.manifest}">
          <srcfiles dir="${classes}"
    <condition property="awregister.echo-value" value="false">
      <equals arg1="${awregister.manifest-up2date}"
    <property name="awregister.echo-value" value="true"/>
       message="awregister.manifest-up2date = ${awregister.echo-value}"/>

The additional <condition> checks to see if "awregister.manifest-up2date"
isn't set (ie., is literally equal to "${awregister.manifest-up2date}"),
in which case the echo value property will get set to 'false'. Otherwise,
the <property> task will set the (unset) echo value property to 'true'
(note that it won't get set to 'true' if it was already set to 'false',
since properties are immutable).



Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!

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

View raw message