itgoyo / AndroidSummary

12 stars 4 forks source link

Android Gradle打包名字 #133

Open itgoyo opened 1 year ago

itgoyo commented 1 year ago
//打包自动生成名字
    android.applicationVariants.all { variant ->
        variant.outputs.all {
            if (variant.getFlavorName().equals("abc")) {
                outputFileName = "${variant.getFlavorName()}_${variant.versionName}_${variant.buildType.name}_${releaseTime()}.apk"
            } else {
                outputFileName = "${variant.getFlavorName()}_${variant.versionName}_${variant.buildType.name}_${releaseTime()}.apk"
            }

        }
    }