ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <>
Subject Better property handling...
Date Mon, 11 Feb 2002 17:35:31 GMT

A quick little question to fellow ANT users and gurus. The little task at
the bottom of this email sets the awregister.manifest-up2date property to
true if the condition is valid/true, and I use an echo message to printout
the result. This yields the following when it is true.

P:\com_lgc\mowi>mowi-build awregister.manifest-up2date?
Buildfile: P:\com_lgc\mowi\build\build.xml
awregister.manifest-up2date = true
Total time: 1 second

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}! In Korn shell, I'd simply do
${awregister.manifest-up2date?false} (or something like that, it's been a
long time). In ANT, no such luck. I'm sure I could manage to print out the
right message with other targets with the proper if/unless attributes, but
how messy is that!?!?!?

Any way to do that cleanly?
Any plans to support alternate value if not set ${varname?default} and/or
substitutions ${varname:this=that} à la makefile/kornshell?
Any plans to check against property values in if/unless instead of just
whether the property exists?

I'd appreciate any input. Thanks, --DD

PS: I'm new to this list. It's not in the FAQ. Sorry if it's been talked
about already.

P:\com_lgc\mowi>mowi-build clean

  <target name="awregister.manifest-up2date?">

    <condition property="awregister.manifest-up2date">
        <available property="classes-dir-exists"
                   type="dir" />
        <uptodate targetfile="${awregistration.manifest}">
          <srcfiles dir="${classes}"
                    includes="com/lgc/mowi/pres/**/*.class" />
    <echo message="awregister.manifest-up2date =
${awregister.manifest-up2date}" />

  </target><!-- awregister.manifest-up2date? -->

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

View raw message