Issue
Is it possible to have an Application subclass that's used only for tests when building with gradle? I've done something like this in the past before the gradle build system, but I can't find a way to do so now. The problem seems to be that it's impossible to customize the AndroidManifest.xml
used for the instrumentation test APK.
Solution
You can create build variants which would at let you have a different version of the Application class and let you override the manifest. You could then test only that specific variant. http://tulipemoutarde.be/2013/10/06/gradle-build-variants-for-your-android-project.html
http://tools.android.com/tech-docs/new-build-system/user-guide
"For instance, if the flavors are used to generate a ads-based app and a paid app, one of the flavors could have a dependency on an Ads SDK, while the other does not.
dependencies { flavor1Compile "..." } In this particular case, the file src/flavor1/AndroidManifest.xml would probably need to include the internet permission."
Answered By - Eric Woodruff
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.