They're really different: Lint's unused resource detector *only* looks at your code for resources that can be removed (e.g. it won't list resources from appcompat that aren't used by your app and therefore can be removed.) Lint also doesn't limit its scan to resources reachable from code remaining after code shrinking.
This is how the build-time resource shrinker gets most of its gains: it can remove resources from libraries that you depend on. Resources in those aren't unused in general, but they may be unused in *your* app if nothing in your app calls into the library methods that end up referencing those resources. The lint rule on the other hand helps you clean up your own source code, removing code that doesn't need to be there etc. -- Tor On Wed, Nov 25, 2015 at 9:41 AM Dallin Wilcox <[email protected]> wrote: > What is the relationship between the newly announced Resource Shrinking > and the Lint Unused Resources rule? > > If I have configurations in my lint xml, say, something like this: > <issue id="UnusedResources"> > <ignore path="res/drawable-mdpi/alpha.png" /> > <ignore path="res/drawable-mdpi/bravo.png" /> > <ignore path="res/drawable-mdpi/charlie.png" /> > <ignore path="res/drawable-mdpi/delta.png" /> > <ignore path="res/drawable-mdpi/echo.png" /> > ... > > Are those taken into consideration in the resource shrinking step by > proguard? Or do I need to translate those to proguard configs? I would > think that may be the case, particularly if strict mode is enabled. > > Conversely, if I have the proguard configs, do I need to create the > corresponding lint configs so the lint warnings still don't show up in the > IDE, or are they inferred from the proguard configs? > > Refer to this section of the Android Studio for Experts (Android Dev > Summit 2015) talk > <https://www.youtube.com/watch?v=Y2GC6P5hPeA&feature=youtu.be&t=1027> for > context. > > -- > You received this message because you are subscribed to the Google Groups > "adt-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "adt-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
