Created
October 11, 2017 19:59
-
-
Save frontrangerider2004/3c1df3fb94bba28c3bda6f69037980fd to your computer and use it in GitHub Desktop.
semantic version names for output apk files
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
android { | |
...... other stuff here | |
.... | |
// Rename output apk file to use semantic versioning (gradle 3.2+) | |
// This will create hyde-x.x.x-${productFlavor}-${buildType}-${isSigned}.apk | |
applicationVariants.all { variant -> | |
variant.outputs.each { output -> | |
def originalOutputFile = output.outputFile | |
output.outputFile = new File(originalOutputFile.parentFile, | |
originalOutputFile.name.replace("${archivesBaseName}", "${archivesBaseName}-${variant.versionName}")) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment