-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to disable plugin for certain flavors #27
Comments
I've used a workaround for this issue thats not perfect but works. Here is a stripped sample from my build.gradle: apply plugin: 'com.android.application'
... other plugins ...
// indicates weather devmetrics should be activated or not.
// Override in desired flavor/buildconfig if you want it
def useDevMetrics = false
android {
... general configuration stuff ...
productFlavors {
internal {
... other stuff ...
useDevMetrics = true
}
prod {
... other stuff ...
}
}
}
// This has to be applied here and not on top with the other plugins
// otherwise the flavor configuration was not done and it would never be true resulting in failing builds
if (useDevMetrics) {
apply plugin: 'com.frogermcs.androiddevmetrics'
} |
@CaptnBlubber could this be used in |
This is not work. On each build, useDevMetrics will be set to true |
There should be an option to disable plugin for certain product flavors, for example I use a specialized flavor for instrumented testing, where I need all debug tools to be off, since their notifications and actions might interfere with Espresso tests. Right now, if the plugin is not initialized in
Application
for every debug product flavor, the app will throw a runtime exception:It means that something like this:
is not possible, as the mockDebug build variant will throw the aforementioned exception.
The text was updated successfully, but these errors were encountered: