Last active
August 29, 2015 14:10
-
-
Save robUx4/c83644f079c65033805c to your computer and use it in GitHub Desktop.
Gradle plugin transition from 0.12/0.13 to 0.14/1.0.0
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
// enable proguard on all version of the android gradle plugin | |
release { | |
if (!properties.findAll{it.key == 'runProguard'}.isEmpty()) { | |
runProguard true | |
} else if (!properties.findAll{it.key == 'minifyEnabled'}.isEmpty()) { | |
minifyEnabled true | |
} | |
} | |
// detect proguard in a variant | |
applicationVariants.all { variant -> | |
def usesProguard = false | |
if (!variant.buildType.properties.findAll{it.key == 'runProguard'}.isEmpty()) { | |
usesProguard = variant.buildType.runProguard | |
} else if (!variant.buildType.properties.findAll{it.key == 'minifyEnabled'}.isEmpty()) { | |
usesProguard = variant.buildType.minifyEnabled | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment