build.gradle
applicationVariants.all { variant -> variant.outputs.each { output -> def apkName = "" def formattedDate = new Date().format('MMdd') def revisionHash = ["sh", "-c", "cd ${project.rootDir} ; git rev-parse --short=10 HEAD"].execute().in.text.trim() def lastName = variant.versionName + "_" + formattedDate + "_"+revisionHash+".apk" if (variant.buildType.name == "release") { apkName = "Appname_" + lastName } else { apkName = "Appname_dev" + lastName } output.outputFile = new File(output.outputFile.parent, apkName) } }
댓글
댓글 쓰기