Skip to content

Instantly share code, notes, and snippets.

@shaobin0604
Forked from twocity/build.gradle
Created August 22, 2014 16:21
Show Gist options
  • Save shaobin0604/ffd307be3018e5a79c03 to your computer and use it in GitHub Desktop.
Save shaobin0604/ffd307be3018e5a79c03 to your computer and use it in GitHub Desktop.
android.applicationVariants.all { variant ->
println "*********" + variant.description + "**********";
def variants = variant.baseName.split("-");
def apkName = "ricebook-";
apkName += variants[0];
apkName += "-v" + android.defaultConfig.versionName;
if (!variant.zipAlign) {
apkName += "-unaligned";
}
if (variant.buildType.name == "release") {
apkName += "-RELEASE.apk";
} else {
apkName += "-SNAPSHOT.apk";
}
println "*********" + "$project.buildDir/apk/" + apkName + "**********";
variant.outputFile = file("$project.buildDir/apk/" + apkName)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment