I change my ProGuard configuration depending upon the gradle build type. I do this so that I can magically disable certain code when creating a release build.
Example builds:
buildTypes {
debug {
minifyEnabled true
proguardFiles 'proguard-debug.cfg'
}
release {
minifyEnabled true
proguardFiles 'proguard.cfg'
}
}
Android Studio is content to add the proguard.cfg
file to my Project View, but not the proguard-debug.cfg
file.
Example Project View from my project (it shows my proguard config and from a library module, but not from my debug config).
Structure of the directory:
project
-- .gradle
-- .idea
-- app (module)
-- -- src
-- -- Other files / folders
-- -- proguard-debug.cfg
-- -- proguard.cfg
-- -- proguard-release.cfg
-- Other files / folders
-- build.gradle
-- settings.gradle