• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Not able to loadproperty file in build.xml ..please help

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
As I was working with ANT faced a problem which is as follows :
My build.xml look like this :
<project name = "Hello" default = "init.release">
<target name ="init.release" if="release">
<loadproperties srcFile = "release.txt" />
<mkdir dir = "${release.dir}" />
</target>
<target name ="init.build" unless="release">
<loadproperties srcFile = "build.txt" />
<mkdir dir = "${build.dir}" />
</target>
</project>
This means : I have two targets init.build and init.release. From Command Promt if I give "ant init.release -Drelease=true" this will load the property from sourcefile "release.txt" and create a directory with name of "release" as mentioned in the property.Content of "release.txt" is like :
<property name="release.dir" value = "release" />

When I am running ANT it is creatting the directory name as "${release.dir}" instead of "release" ..what may be cause of this ? kindly help . Waiting for an aspiring response from your side. Thank you.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Bhaskar Mukhejee:
Content of "release.txt" is like :
<property name="release.dir" value = "release" />



The loadProperties task loads a properties file. A properties file contains a name-value pairs. So your properties file should contain:

 
Bhaskar Mukhejee
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks jaikiran it is working now..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic