[Source : http://wiki.apache.org/ant/AntTasks]

Problem Statement: To read value of a variable declared in input.properties within your build.xml

Assume there are two files:
[1] build.xml
[2] input.properties

 input.properties
build.xml
 <!-- AppServer Location -->
AS.DIR = /space/AS/appserver
 <property file="input.properties" prefix="input"/>
<echo>value of App Server directory is ${input.AS.DIR}</echo>
 

To reference the value AS.DIR which is present in input.properties ,you can use the <property> element with a <prefix> attribute from build.xml .


 

Comments:

Hi,

This is a very valuable tip. Would you mind answering
one more question please?

I have a file, which has names of testcases to be execu
-ted by JUnit test runner.

I need to read this file, and substitute them to the
ant task as test cases. Is there a way to do this using
ant tasks?

thanks and regards
Nitesh.

Posted by Nitesh on May 19, 2008 at 10:26 AM PDT #

isnt it different from this blog post that you are trying to achieve?

Posted by Thekkadath on May 19, 2008 at 08:58 PM PDT #

Yes, it is different but I was expecting the solution to be on
similar lines, i.e a way of substituting a dynamic variable with
names fetched from a file.

Thanks and regards
Nitesh

Posted by Nitesh on May 19, 2008 at 10:13 PM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by thekkadath