Skip to content

Instantly share code, notes, and snippets.

@SelvinPL
Created June 26, 2015 13:20
Show Gist options
  • Select an option

  • Save SelvinPL/4b8213d789c88dd7a279 to your computer and use it in GitHub Desktop.

Select an option

Save SelvinPL/4b8213d789c88dd7a279 to your computer and use it in GitHub Desktop.
project.ext.versionCode = project.hasProperty("versionCode") ? project.versionCode.toInteger() : 3
project.ext.versionName = project.hasProperty("versionName") ? project.versionName : "1.0"
android {
defaultConfig {
versionCode project.versionCode
versionName project.versionName
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.outputFile = new File(output.outputFile.parent,
output.outputFile.name.replace("app-debug.apk",
"MyApp_" + "_v" + project.versionName + "." + project.versionCode + ".apk"))
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment