Last active
October 19, 2018 20:34
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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