Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ant -- referencing properties

 
Matthew Sessoms
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an ant file and a property file. Say, for example, the property file contains properties 'a', 'b', and 'c'. The ant file takes command-line arguments, which should match either of the properties in the property file. Using the command-line arguments, I want to get the value of its corresponding property.

If ${input} contains the command-line argument, how do I reference ${input} so that it accesses ${a}? ${input} outputs 'a', and $${input} outputs ${input}, and ${${input}} outputs itself. If a=33, I want to be able to use 'input' so that I can access 33.

Thanks
Matt
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that the PropertyCopy task in antcontrib will do what you want:
http://ant-contrib.sourceforge.net/tasks/tasks/index.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic