import-bot (20211) [Avatar] Offline
#1
[Originally posted by azure]

Hi.

We use a properties-file to control our application. We have one
properties-file that contains default values (config.properties). The
developer/deployer can override values in this file by setting a property -
merge.prefix - to some value.

If merge.prefix is set to "my", then the file my.config.properties will be
merged with config.properties and the resulting file copied to the destination
as config.properties.

This procedure is used to build releases for development, acceptans, testing,
production environments etc.

We've written a custom ANT-task to do this, and it works nicely. But -
something tells me that this could be done with the standard ANT-tasks... If
it can, how?

Best Regards //Anders
import-bot (20211) [Avatar] Offline
#2
Re: Merging property files
[Originally posted by erikhatcher]

There was a task written for Jetspeed (by Eric Pugh) that will merge property
files, but there is no
good way to do this with Ant out of the box. You can probably do some things
with
<propertyfile> and <property file="...">, but it won't be as good as a custom
solution.
peter_h (3) [Avatar] Offline
#3
Re: Merging property files
Try using <exec> call to an external software that can edit the XML file. For instance, I'm experimenting with XML-Starlet. A bit clunky but works.