Phing: How to export defined properties to file
I’ve been very annoyed that I have to define properties in 2 different places. Given the following scenario:
* config target gets called, does a bunch of property prompts
* writeConfig target gets called, writes properties to file
You’d have to have a template file with the properties already defined, then you’d have to copy that file to a config file with the filter expand properties.
But that sucks, I only want to call propertyprompts and have those properties saved to files, so I wrote a custom task exactly for that.
You can grab this custom task from Snipplr
To use it:
<taskdef name=”ExportProperties” classname=”Path.To.Phing.Task.ExportProperties” />
<ExportProperties targetFile=”phing.properties” />
Enjoy!



