I have inherited a Java application (servlets) that runs under Tomcat. For historical reasons, the code has different "appearance" options, based on where the application will be deployed (mainly a branding issue).
There are several constants that control this branding process, which has different functions and should not be compacted into one constant (for example, BRAND, MULTI-LANGUAGE, as well as the location of CSS icons and stylesheets, etc.).
Currently, the development team must manually change the constants (they are at least localized in the same data class and well-documented), and then recompile the application using ANT.
What is the best way to automate this process, assuming at least Ant 1.8 and Java 6.x?
I know that there were no good solutions using compiler arguments (how can this be done in C or C ++), and I tend to the βbest wayβ to edit the source file containing the constants, or to put them in another file and their replacement using the Ant build process. I would like to get a result that will work using something like "ant build brand-x", where changing the brand will change the final assembly.
Thanks,
-Richard
source
share