I would like to automate my Android project building with Ant. Currently I have to change some static String and Boolean fields in one of the classes for different kind of versions of the same app for different markets.
Is it possible to set these variables with Ant, without resorting to copying a file with some strange markers in it? I want to be able to keep using the files in Eclipse.
You can, but you shouldn’t. Don’t make your Ant build file mess with the code; it leads to strange and confusing errors that are hard to find.
Instead, use java Properties.
Here’s a little example of how a
static finalcan be initialized in astaticblock: