shaobin0604
8/22/2014 - 4:21 PM

build.gradle

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)
}