How to change the proguard mapping file name in gradle for Android project

后端 未结 12 1694
灰色年华
灰色年华 2020-11-30 08:48

I have android project based on gradle and I want to change mapping.txt file name after it\'s generated for my build. How can it be done?

upd

How it can be d

12条回答
  •  日久生厌
    2020-11-30 09:18

    A complete solution that worked for me

    applicationVariants.all { variant ->
            def variantType = variant.buildType.name
            if (variantType == "release") {
                variant.assemble.doLast {
                    def mappingFile = variant.mappingFile
                    mappingFile.renameTo(mappingFile.parent + "/mapping-${variant.name}.txt")       
                }
            }
        }
    

提交回复
热议问题