Ant script to fetch property value from another property file

143 Views Asked by At

I have 2 properties files as below a.properties has list of property names b.proprties has list of its corresponding values

a.properties

Application=

ApplicationID=

BU=

b.properties

ACCSRV

ACCSRV

BT

I am looking for ant script which can give me final properties file with out out as below:

Final.properties:

Application=ACCSRV

ApplicationID=ACCSRV

BU=BT

1

There are 1 best solutions below

0
Ville Oikarinen On

Sounds like you need an external tool for this. If you can depend on unix tools, you can use the paste command (see man paste) and run it from ant using the exec task. If not, you can either

  • write the tool in java, then use tasks javac and java to compile and run it from ant
  • or use the script task to embed the tool in your ant script using some scripting language