Skip to content

Instantly share code, notes, and snippets.

@oliverspryn
Last active October 19, 2018 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oliverspryn/b0fd24b7a19c732f3416b42f52fcbf5e to your computer and use it in GitHub Desktop.
Save oliverspryn/b0fd24b7a19c732f3416b42f52fcbf5e to your computer and use it in GitHub Desktop.
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