How to set versionName in APK filename using gradle?
I'm trying to set a specific version number in the gradle auto-generated APK filename. Now gradle generates myapp-release.apk but I want it to look something like myapp-release-1.0.apk . I have tried renaming options that seems messy. Is there a simple way to do this? buildTypes { release { signingConfig signingConfigs.release applicationVariants.each { variant -> def file = variant.outputFile variant.outputFile = new File(file.parent, file.name.replace(".apk", "-" + defaultConfig.versionName + ".apk")) } } I have tried the code above with no luck. Any suggestions? (using gradle 1.6) I only