You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Reeves, Paul C" <pc...@sandia.gov> on 2004/07/21 16:46:59 UTC
Property is set, but to what?
Folks,
Does anyone know what happens when a property is set via a property file,
but there is nothing on the right-hand side of the equals sign?
Ex:
prop1 =
prop2 = value2
When I load these properties then
<isset property="prop1">
returns "true"
If I echo the value held by the property:
<echo message="prop1 = (${prop1})"/>
I get:
prop1 = () (i.e., nothing shows up between parentheses)
I need to be able to test for this condition via ant contrib's <if> task,
but I cannot figure out what to compare to:
<if>
<equals arg1="${prop1}" arg2="???"
.
.
.
I've tried
<equals arg1="${prop1}" arg2="
"/>
<equals arg1="${prop1}" arg2=" "/>
<equals arg1="${prop1}" arg2="	"/>
<equals arg1="${prop1}" arg2=" "/>
<equals arg1="${prop1}" arg2="false"/>
which I believe are:
Line Feed
Carriage Return
Tab
Space
false
respectively, but none of these seem to work.
Any idea what the prop1 actually holds?
Paul
P.S. New Mexico State Motto: "Carpe Manana"
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Property is set, but to what?
Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Reeves, Paul C wrote:
> Folks,
>
> Does anyone know what happens when a property is set via a property file,
> but there is nothing on the right-hand side of the equals sign?
Off the top of my head I would say it contains nothing = i.e. no characters.
> I've tried
>
> <equals arg1="${prop1}" arg2="
"/>
> <equals arg1="${prop1}" arg2=" "/>
> <equals arg1="${prop1}" arg2="	"/>
> <equals arg1="${prop1}" arg2=" "/>
> <equals arg1="${prop1}" arg2="false"/>
>
How about
<equals arg1="${prop1}" arg2=""/>
Again just of the top of my head.
Conor
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: Property is set, but to what?
Posted by Bill Rich <bi...@attglobal.net>.
I would guess that the value of prop1 is null. Try using <if> <equals
arg1="${prop1}" arg2=""/>... to see if that helps.
Thanks. Bill
Bill Rich
Wilandra Consulting LLC
1325 Addiewell Place
San Jose, CA 95120-3905
phone: +1 408 268-2452
mobile: +1 408 410-9713
Santa Cruz: +1 831 464-9007
fax: +1 413 669-9716
billrich@wilandra.com or billrich@attglobal.net
http://www.wilandra.com
-----Original Message-----
From: Reeves, Paul C [mailto:pcreeve@sandia.gov]
Sent: Wednesday, July 21, 2004 7:47 AM
To: 'user@ant.apache.org'
Subject: Property is set, but to what?
Folks,
Does anyone know what happens when a property is set via a property file,
but there is nothing on the right-hand side of the equals sign?
Ex:
prop1 =
prop2 = value2
When I load these properties then
<isset property="prop1">
returns "true"
If I echo the value held by the property:
<echo message="prop1 = (${prop1})"/>
I get:
prop1 = () (i.e., nothing shows up between parentheses)
I need to be able to test for this condition via ant contrib's <if> task,
but I cannot figure out what to compare to:
<if>
<equals arg1="${prop1}" arg2="???"
.
.
.
I've tried
<equals arg1="${prop1}" arg2="
"/>
<equals arg1="${prop1}" arg2=" "/>
<equals arg1="${prop1}" arg2="	"/>
<equals arg1="${prop1}" arg2=" "/>
<equals arg1="${prop1}" arg2="false"/>
which I believe are:
Line Feed
Carriage Return
Tab
Space
false
respectively, but none of these seem to work.
Any idea what the prop1 actually holds?
Paul
P.S. New Mexico State Motto: "Carpe Manana"
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional
commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org