Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant isset behaviour

Tags:

ant

According to the documentation isset clause "Test whether a given property has been set in this project". I don't understand wheter isset returns true or false when a property is set In the below code snippet java.pass.home is set to somval when env.JAVA_HOME is not set .

<condition property="java.passed.home" value="somval">
    <isset property="${env.JAVA_HOME}"/>
</condition>

This snippet works for my requirement but i think the correct code snippet should be something like this as i want to set the property when another property is not available

<condition property="java.passed.home" value="somval">
    <not>
        <isset property="${env.JAVA_HOME}"/>
        </not>
    </condition>

Can some one please clarify this? Thanks in advance

like image 269
Raj Avatar asked Jan 02 '14 09:01

Raj


1 Answers

The code snippet was right but the property should be mentioned with just name without enclosing it with {}

<isset property="${env.JAVA_HOME}"/>

It should be

<isset property="env.JAVA_HOME"/>
like image 73
Raj Avatar answered Oct 20 '22 03:10

Raj