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
gradle.allprojects { | |
ext.getCurrentProductVariant = { | |
def taskName = project.gradle.startParameter.taskNames.find { it.contains("assemble") } | |
if (taskName != null) { | |
def variantParts = taskName.split(/(?<!^)(?=[A-Z])/)[-2..-1].collect { it.toLowerCase() } | |
return new ProductVariant(buildType: variantParts[1], productFlavor: variantParts[0]) | |
} | |
return null | |
} | |
} |