1

The problem we have are as follows:

We are using ANT to build our application. However, the application is built multiple times, once for each client (they have different skins / cms / i18n etc). Up to now, we had no need to compile them all at once (usually just work on one client at a time). Now, we want our build server to build all permutations for all clients in all languages. In other words, we need to create a war file for each client, each containing their own compilation.

At the moment, the client name is read in from the application's .properties file.

My question is this. Is there any way that the client.name property (from the application's .properties) be overridden in the build.xml used by ant? Or is the only way to create a different target for each client and hard-coding the name?

Thanks.

Nico Huysamen
  • 10,217
  • 9
  • 62
  • 88

1 Answers1

2

If you use Hudson to do your build, and have more than one parameter to change, you should be able to do a Matrix Build. There is more detail in this answer.

If it is just one parameter, you should be able to do a properties file and use Ant to read this properties file and iterate through it - I'm not sure precisely how, but you won't be the first person to have this problem, and if you are it wouldn't be difficult to create your own task. Or if not use Macros.

Community
  • 1
  • 1
Rich
  • 15,602
  • 15
  • 79
  • 126
  • Thanks. We are using Hudson. Will look in to this. – Nico Huysamen Nov 25 '10 at 08:13
  • Unfortunately this will not work for us. Using the Matrix builds will run the entire build for each client. Our unit tests etc. take a really long time, and we do not want to run them for each client as nothing functional differs between them. – Nico Huysamen Nov 25 '10 at 08:26
  • Obviously I don't know your build setup, but you should be able to have two builds, the first is "Test Project" which runs your tests, the second is "Matrix Project" which runs your permutations. The second project can be a dependancy on the first, and will therefore only run if the tests pass or the build is successful or some other criterion. – Rich Nov 25 '10 at 08:31
  • Mmmm, that sounds interesting. I'm busy setting up a new machine to play with the builds a bit. Wil give that a try. Our current build scripts etc. have been so patched on over the years, probably about time it's re-done. Thanks for the info! – Nico Huysamen Nov 25 '10 at 08:56