-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shrinked resources support #22
Comments
That could be possible, but not a high priority for now as it would likely be an independent implementation. PRs welcome! |
Specific things that would be needed:
|
Looking into this a bit ButterKnife has an example of reading the R.txt file: https://github.com/JakeWharton/butterknife/blob/master/butterknife-gradle-plugin/src/main/java/butterknife/plugin/ButterKnifePlugin.kt#L56-L89 Resource shrinking is handled by
There is also a There is a There's a I'm hoping we can reuse their resource finding analyzer without needing to copy anything over. If that's the case, this could hopefully be as easy as running the usage analyzer on androidTest sources/resources/manifest, then generate a keep file based on all the usages that are in the original app's processed resources. The final piece to this puzzle is the hardest though. Merged resources are stored in binary formats ("compiled XML"). We can create a keep file, compile it, and write it out + copies of all the existing ones. But this is a murky area of the the sdk and I don't really know what I'm doing :/. If someone wants to contribute this, we'd be super open to a PR. Right now though, this is far more complex than what the library currently does. |
I faced an issue, that is not an
keeper
fault, but thought it might be a good improvement.With
shrinkResources = true
if test code dynamically reference some resources from target app, but app itself not - it ends up shrinked (just like code without keeper).More context in our repo PR: https://github.com/avito-tech/avito-android/pull/148/files#diff-9d9fe566f80ff63b20a99099ded9080f
Could it be somehow analysed beforehand? Because adding pre-generated
keep.xml
is not a big dealThe text was updated successfully, but these errors were encountered: