ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Patrizio.Ferl...@b-source.ch>
Subject how to check that a property exist
Date Wed, 11 Jun 2008 10:22:23 GMT
Hi all,

I'm trying to find out a solution for the below issue.

I've a properties file like that:

...
defaultPollerManagedServer=A
TestEvent.pollerManagedServer=B
DummyEvent.pollerManagedServer=C
...

I run my build.xml providing a parameter:

ant -DIPEvent=TestEvent

And I would like to set the value of a property named 'pollerEventValue'
according to these rules:

1) if exists a property like 

    <property name="pollerEvent"
value="${IPEvent}.pollerManagedServer"/>

then the requested value is:

    <property name="pollerEventValue" value="${${pollerEvent}}"/>
?????? but I think the syntax is wrong

2) else take as value

    <property name="pollerEventValue"
value="${defaultPollerManagedServer}"/>

So if I run:

 ant -DIPEvent=TestEvent   the expected value is B
 ant -DIPEvent=other       the expected value is A (the default one)

Could anyone help me to solve that ?

Thanks in advance for any help. 
ferp

IMPORTANT: 
This e-mail transmission is intended for the named 
addressee(s)only. 
Its contents are private, confidential and protected 
from disclosure and should not be read, copied or
disclosed by any other person. 
If you are not the intended recipient, we kindly ask
you to notify the sender immediately by telephone 
(+41 (0)58 806 50 00), to redirect the message to the 
account "info@b-source.ch" and to delete this e-mail.
E-mail transmissions may be intercepted, altered or 
read by unauthorized persons and may contain viruses.
Therefore, it is recommended that you use regular mail
or courier services for any information intended to be 
confidential. However, by sending us messages through
e-mail, you authorize and instruct us to correspond by 
e-mail in the relevant matter. 
Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message