ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 10952] - condition task broken
Date Thu, 18 Jul 2002 17:10:09 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10952>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10952

condition task broken





------- Additional Comments From hoju@visi.com  2002-07-18 17:10 -------
Can you give me an example of what you mean by this?

The following works, but seems very kludgy:

<echo message="|${ant.java.version}|" />
<echo message="${javadoc.breakiterator}" />
<condition property="javadoc.breakiterator" value="-breakiterator" >
    <or>
        <equals arg1="${ant.java.version}" arg2="1.4" />
        <equals arg1="${ant.java.version}" arg2="1.5" />
    </or>
</condition>
<condition property="javadoc.breakiterator" value="">
    <equals arg1="${javadoc.breakiterator}" arg2="${javadoc.breakiterator}" />
</condition>
<echo message="${javadoc.breakiterator}" />

The output I get from this is:

[echo] |1.4|
[echo] ${javadoc.breakiterator}
[echo] -breakiterator

If I change the first <equals> element's second argument to be "1.3" I get:

[echo] |1.4|
[echo] ${javadoc.breakiterator}
[empty space here]

Note that if I didn't do the second <condition>, the value of 
${javadoc.breakiterator} would be "${javadoc.breakiterator}" where I need it to 
be an empty string if the <condition> turns out to be false.

So, I've achieved what I want, but it is much messier than just having the 
<condition> overwrite the existing value.  There must exist a simpler way that 
I am missing.  Can you point it out?

thanks,

Jake

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message