时间:2021-11-26 11:55:16 | 栏目:Android代码 | 点击:次
多渠道打包变更
flavorDimensions "default" productFlavors { xxxx { dimension "default" } } productFlavors.all { flavor -> flavor.manifestPlaceholders = [CHANNEL_VALUE: name] }
更改打包命名及路径
android.applicationVariants.all { variant -> if (variant.buildType.name == 'release') { variant.outputs.all { output -> def outputFile = output.outputFile if (outputFile != null && outputFile.name.endsWith('.apk')) { def fileName = "${variant.flavorName}.apk" outputFileName = new File("../../../apk", fileName) } } } }
总结