For Ant Script I have following myBuild.properties
file
p.buildpath=c:\production\build
d.buildpath=c:\development\build
I wrote following build.xml
:
<?xml version="1.0"?>
<project name="Test Project" default="info">
<property file="myBuild.properties"/>
<target name="info">
<input
message="Please enter the Server Name(p: production, d: development)?"
validargs="p,d"
addproperty="do.Server"
/>
<echo>Your Server type: ${do.Server} </echo>
<property name="myserv.buildpath" value="${do.Server}.buildpath" />
<property name="newProperty" value="${myserv.buildpath}" />
<echo>New Property Value: ${newProperty}</echo>
<!-- Following is an incorrect syntax -->
<echo>Build Path: ${${newProperty}}</echo>
</target>
</project>
When I run it using:
c:\>ant
I get following Output:
Buildfile: C:\build.xml
info: [input] Please enter the Server Name(p: production, d: development)? (p, d)
p
[echo] Your Server type : p
[echo] New Property Value: p.buildpath
[echo] Build Path: ${${newProperty}}BUILD SUCCESSFUL
Total time: 2 seconds
I want to echo the "Build Path" value same as p.buildpath
value.
How is it possible to do in above case?