Skip to content

Instantly share code, notes, and snippets.

@oliverspryn

oliverspryn/app.gradle

Last active Oct 19, 2018
Embed
What would you like to do?
A Gradle script which conditionally exclude a plugin based on the build variant
// Run with: ./gradlew --build-file build.gradle assembleNoDynatraceDebug
def task = gradle.startParameter.taskNames[0] ?: "" // Get "assembleNoDyntraceDebug"
if (!task.toLowerCase().contains("nodynatrace")) {
apply plugin: 'com.dynatrace.tools.android'
dynatrace {
defaultConfig {
...
}
productFlavors {
dynatraceDev {
...
}
dynatraceProd {
...
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.