java - Can I use Ant to set some static variables in my Android project when building? -


I want to automate my Android project building with ant. Currently, I have to change some stable strings and boolean fields in one of the classes for different types of versions of the same app for different markets.

Is it possible to set these variables with ant, without copying the file with no strange markers? I want to continue using files in Eclipse

You can , but you should not have code with your Do not mess up the creation of ant;

Instead, use

Here is a short example of how a static last can be started in a static block:

  Square junk {public static last int j; Use static {// java.lang.Properties to get values ​​= 42; } Public static zero main (string [] argv) {System.out.printf ("Answer is% d \ n", j); }}    

Comments