Skip to content

Instantly share code, notes, and snippets.

@robUx4
Created March 5, 2014 06:54
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 robUx4/9362413 to your computer and use it in GitHub Desktop.
Save robUx4/9362413 to your computer and use it in GitHub Desktop.
Copy the Proguard mapping.txt next to the apk with a matching name
android.applicationVariants.all { variant ->
if (variant.buildType.runProguard) {
variant.assemble.doLast {
description "ProGuard mapping copy"
def mappingSource = new File(projectDir, "build/proguard/" + variant.buildType.name+"/mapping.txt")
def mappingDest = new File(variant.outputFile.parent)
copy {
from mappingSource
into mappingDest
rename { String fileName ->
fileName.replace('mapping.txt', variant.outputFile.name.replace(".apk", "-mapping.txt"))
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment