You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, you should assume that referenced_color is referenced from only one code, i.e. referencer_color, and referencer_color is not referenced from anywhere.
Then, referencer_color must be removed and this plugin does behave like so. :) After removing that, referenced_color's reference count would be changed from 1 to 0 so that this plugin should remove referenced_color too.
So kinda reference count concept should be considered during removing.
More complex reference case across file-grained and value-grained Removers
# in drawable/xml_drawable.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/jpg_drawable"/>
</selector>
# in values/styles.xml
<style name="StyleSample">
<item name="android:background">@drawable/xml_drawable</item>
</style>
Let's say:
drawable/jpg_drawable.jpg is available
drawable/jpg_drawable.jpg is referenced from only xml_drawable
xml_drawable is referenced from only StyleSample
StyleSample is not referenced from anywhere.
Run a task once, then StyleSample should be removed (of course, your plugin works fine! ). After that, run a task again, then xml_drawable would be removed. Again, drawable/jpg_drawable.jpg would be removed.
Files, which would be marked as unused after removing values, cannot be removed by running a task once. Because file removers are run before value removers.
The text was updated successfully, but these errors were encountered:
Thanks for your report and sorry for late response!
I know what you mean. Let me consider how to solve this issue 🤔
One easy option is to run several time. But it takes too much time to finish task.
I guess other option would make logic complex. So I'm thinking how this should be fixed...
Thank you for providing a wonderful plugin! :)
BTW, should I run
removeUnusedResources
task twice or more to assure Completed?In our case, it's not enough to remove resources by running
removeUnusedResources
only once due to a reference graph.(These examples are just based on my quick look so that other cases might exist.)
Simple reference case in value-grained Remover
For example, you should assume that
referenced_color
is referenced from only one code, i.e. referencer_color, andreferencer_color
is not referenced from anywhere.Then,
referencer_color
must be removed and this plugin does behave like so. :) After removing that,referenced_color
's reference count would be changed from 1 to 0 so that this plugin should removereferenced_color
too.So kinda reference count concept should be considered during removing.
More complex reference case across file-grained and value-grained Removers
Let's say:
drawable/jpg_drawable.jpg
is availabledrawable/jpg_drawable.jpg
is referenced from onlyxml_drawable
xml_drawable
is referenced from only StyleSampleRun a task once, then StyleSample should be removed (of course, your plugin works fine! ). After that, run a task again, then
xml_drawable
would be removed. Again,drawable/jpg_drawable.jpg
would be removed.Files, which would be marked as
unused
after removing values, cannot be removed by running a task once. Because file removers are run before value removers.The text was updated successfully, but these errors were encountered: