Skip to content

Instantly share code, notes, and snippets.

@robUx4
Created March 5, 2014 06:57
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/9362439 to your computer and use it in GitHub Desktop.
Save robUx4/9362439 to your computer and use it in GitHub Desktop.
Output the APK in a "builds" folder outside of the source tree with specific names between buildtypes and versionCodes
android.applicationVariants.all { variant ->
if (variant.buildType.name == "release") {
variant.outputFile = new File(projectDir.parent + "/builds", archivesBaseName + "-" + versionName + ".apk")
} else if (variant.buildType.name == "kindle") {
variant.outputFile = new File(projectDir.parent + "/builds", "Kindle-" + versionName + ".apk")
} else {
variant.outputFile = new File(projectDir.parent + "/builds", archivesBaseName + "-" + variant.buildType.name + versionCode + ".apk")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment