Last active
February 16, 2017 16:41
-
-
Save marcouberti/b2307f2298ed79ffb944ce562acd4131 to your computer and use it in GitHub Desktop.
Copy and rename mapping.txt file if minify is enable
This file contains hidden or 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
android { | |
applicationVariants.all { variant -> | |
def versionCode = android.defaultConfig.versionCode | |
def versionName = android.defaultConfig.versionName | |
def appendToFileName = versionName + "-build-" + versionCode | |
// copy and rename mapping.txt file if in minify is enable | |
if (variant.getBuildType().isMinifyEnabled()) { | |
variant.assemble.doLast{ | |
copy { | |
from variant.mappingFile | |
into "${rootDir}/mappings" | |
rename { String fileName -> | |
"mapping-${variant.name}-${appendToFileName}.txt" | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment