动态输出的包名
android.applicationVariants.all { variant ->
variant.outputs.all { output ->
def outFile = output.outputFile
if (outFile != null) {
def isApkFile = outFile.name.endsWith('.apk')
if (isApkFile) {
def flavorName = variant.productFlavors.get(0).name
def buildTypeName = variant.buildType.name
def outFileName = "appName"+buildTypeName+flavorName
outFileName = new File(outFileName + ".apk")
}
}
}
}
网友评论