Open tiann opened 8 years ago
lint seems can not found cross-module referenced unused resource; the default proguard file of android keep all fields of R class; so we can not distinguish the unused resource correctly??
proguard to found unused class:
-dontoptimize
-dontobfuscate
-dontpreverify
-printusage
source code of shrinkResource
can not use shrinkReleaseResources directly, this task is added dynamicly, we can only access it after the gradle scripts are evaluated:
afterEvaluate { project ->
project.tasks.shrinkReleaseResources << {
doSomeThing()
}
we can debug gradle plugin, use remote debugger:
how to get all resource the project depends on?
get all project: project.rootProject.subprojects
and android
is just a ext property of project, we can access like this:
module.extensions.findByName("android")
used proguard to find unused class: usage.txt contains deleted files.