Reputation: 21445
I have defined a property in my build.properties
file, I am trying to check if the value is properly set or not using below code in my build.xml
file.
<?xml version="1.0" ?>
<project name="myapp" default="showProps">
<target name="showProps">
<echo>My property is ${my_property.data}</echo>
<echo message="${my_property.data}"/>
</target>
</project>
But when I run the ant
command I am getting output as:
showProps:
[echo] My property is ${my_property.data}
[echo] ${my_property.data}
Please tell me how to display the property value?
Upvotes: 0
Views: 720
Reputation: 72884
Pass your properties file in the command-line:
ant -propertyfile build.properties
or load the properties file within the buildfile:
<project name="myapp" default="showProps">
<property file="build.properties"/>
<target name="showProps">
<echo>My property is ${my_property.data}</echo>
<echo message="${my_property.data}"/>
</target>
</project>
Upvotes: 2