Here's an example (great, ain't it...):
<target name="javadocs.uptodate?">
<mkdir dir="${apidocs}" />
<uptodate property="javadocs.uptodate"
targetfile="${apidocs}/index.html">
<srcfiles dir="${src}"
includes="**/*.java,
**/package.html,
**/doc-files/**" />
</uptodate>
<!-- All this to print "true" or "false" for the property value -->
<condition property="javadocs-uptodate-value" value="true">
<isset property="javadocs.uptodate" />
</condition>
<property name="javadocs-uptodate-value" value="false" />
<echo message="javadocs-uptodate = ${javadocs-uptodate-value}" />
</target>
-----Original Message-----
From: Steve Cohen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 05, 2003 3:09 PM
To: Ant Users List
Subject: echo true or false
The <available>, <condition>, etc. set of tasks all work by setting a
property if a condition is met. My problem is that I would like to echo
the results of this test.
<condition property="my.property>
... whatever tests
</condition>
<echo message="my.property=${my.property}"/>
If the property is set,
"true" will be echoed. If it hasn't been set, "${my.property}" will be
echoed.
Pretty ugly. I would like "false" to be echoed.
I would like the ability to set a property true or false depending on
the results of a conditional test.
What is the easiest way to accomplish what I am after?
-----------------------------------------------
Steve Cohen
Sr. Software Engineer
Sportvision Inc.
[EMAIL PROTECTED]
http://www.sportvision.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]