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 done in build.gradle? Since I have access there to my flavors and other stiff, I would like to create mapping file name based on flavor/build variant version.
It is located in the <sdk-root>/tools/proguard/bin/ directory.
To actually apply the plugin to your project, just add the line to your module level build. gradle(. kts) file after applying the Android Gradle plugin as shown below. ProGuard expects unobfuscated class files as input.
Simpler solution.
applicationVariants.all { variant -> if (variant.getBuildType().isMinifyEnabled()) { variant.assemble.doLast { copy { from variant.mappingFile into "${rootDir}/proguardTools" rename { String fileName -> "mapping-${variant.name}.txt" } } } } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With