Skip to content

Instantly share code, notes, and snippets.

@robUx4
Last active August 29, 2015 14:10
Show Gist options
  • Save robUx4/c83644f079c65033805c to your computer and use it in GitHub Desktop.
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
// 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