I'm wondering what is the best way to support multiple build versions using ant. In my current project I have 3 environments (development, test, production). There are 2 production servers with different configs (different databases, active directories, webservice urls, etc).There are at least 2 test versions running at a time. There are additional configuration options that are added just to test behavior with something enabled/disabled.
How to handle it all using ant?
Currently we have some directory with set of files for each configuration (persistence.xml, datasource, web.xml, jboss-specific files, several application property files...) which are copied into proper directories during the build (it's becoming A LOT, and change visible in all configurations requires us to change file for all configurations).
There are tasks like build-moduleA-dev, build-moduleB-dev, build-moduleA-test...
In general the build process looks as follows:
- load build properties
- compile server classes into build dir
- compile web classes into build dir
- build interface (gwt)
- copy static resources and proper configuration files into build dir
- create ears/wars/jars
So, I am wondering:
- How to make it simpler?
- Is it better to keep seperate files or use something like replace task?
- How you do it?