I recently switched to Android Studio / Gradle and I am wondering, how ProGuard can be configured in the build.gradle script. I am new to Gradle, but I thought, configuring the Proguard task would be a good idea (as documented in the Proguard project documentation.
I want to configure Proguard to save the mapping in different files for different product flavors with the 'printmapping' setting
task myProguardTask(type: proguard.gradle.ProGuardTask) {
printmapping file("test.txt")
}
but it crashes on task-execution with
Gradle: Execution failed for task ':module:proguardFlavorVariant'.
> proguard.ConfigurationParser.<init>(Ljava/io/File;Ljava/util/Properties;)V
In the newer versions of the Gradle 'android'-plugin, Proguard seems to be included and I think this might be the reason, why configuring the Proguard task as stated on the Proguard documentation did not work. But I did not find any documentation on this topic of how to do this with the newer android-gradle-plugin.
Thanks for your help!