1

According to the documentation of RoboGuice RoboBlender is optional. Also in the RoboBlender wiki you can find a section about disabling RoboBlender. You can either set an environment property or you do it programmatically.

My question is, how do you set the environment property in the app? I assume you can do that in your gradle build script or somewhere else inside the app (I'm using Android Studio). Or do you really have to set it via the terminal?

schnatterer
  • 7,525
  • 7
  • 61
  • 80
mvieghofer
  • 2,846
  • 4
  • 22
  • 51

1 Answers1

1

I presume that using the environment variable roboguice.useAnnotationDatabases=false is intended for testing only. Why?

  • The doc says it's for testing and
  • the source code says it's testing.
  • Setting an environment variable that contains a dot on the shell is rather complicated. Can't imagine how to do it in Android.

However, if you encounter problems with roboblender in your robolectric tests (running in a "normal" JVM) you could easily set the environment variable for the test in eclipse or maven, for example.

Community
  • 1
  • 1
schnatterer
  • 7,525
  • 7
  • 61
  • 80
  • Thanks for your answer. I just wondered if there is any other possibility to disable RoboBlender since the doc states it is optional. However there is no way to disable it in general. Does this mean the documentation is wrong? – mvieghofer Jun 11 '15 at 08:14
  • I don't know of any other way than doing it programmatically. Maybe they mean by *optional* that RoboGuice in general can be used without RoboBlender. This could definitely be improved in the doc. – schnatterer Jun 11 '15 at 19:51