I have a java library project which contains a dependency to guava library. Guava has near 11k methods count, and I expect most of the users would came from the Android community. On Android there is a limit count method, it is 65k...
But the total count methods of my library is about 11.400, so my library's code is under 200 lines.
I was able to download and shrank a guava jar using proguard, reducing the count method number to 1k. But now the project needs to contain a reference to this shrank jar, instead a reference to the remote repository where the guava is hosted. But any jar added to the project would be discard by maven when it were published at any remote repository as an artifact, so the guava dependencies could not be resolved and the application client ultimately would crash.
Guava itself advices to not use proguard if your “application” is actually a library, and leave to the users of your library deal with this situation, using themselves proguard in order to shrank guava. But I don’t like this idea, because I would like to offer an easy configuration solution.
As far as I know, the output that proguard provides is some sort of executable (jar, apk, etc), so, If I shrank my own library, the final output would be a jar, and this jar, again, could not be published as an artifact, because it would be discarded (I tried it several times).
Is there any way of using proguard in my own java library project and pass the resulting output to the build chain in order to be published as a remote repository, not as a jar?
I’m using gradle by the way to build my project, but at this point I would be up to move to a maven one it that solves the problem.
Thanks.