29

Android has a flag called DEBUG in BuildConfig.java. Can someone please explain how is this file created? What is the purpose of having an auto-generated file with a single variable in it?

Is it possible to have something besides DEBUG flag inside this class? What if I want a configuration other than development and release configuration? How can I achieve it?

Prateek
  • 1,062
  • 1
  • 10
  • 27

1 Answers1

19

BuildConfig.java is generated automatically by Android build tools, and is placed into the gen folder.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Miki Franko
  • 687
  • 3
  • 7
  • Is there a way to customize the build with ant in such a way that we have multiple configurations, besides development and release. – Prateek Dec 09 '14 at 16:12
  • 1
    Hey, try this post: http://stackoverflow.com/questions/5032078/android-use-ant-to-create-build-configurations-that-change-configuration-value Found a tutorial which goes through all the details of using ant to automate a build system, to create and use build configurations, as well as to build the release project with one command. Here it is: http://www.androidengineer.com/2010/06/using-ant-to-automate-building-android.html – Miki Franko Dec 10 '14 at 07:39