Apply proguard to a Java Library Project -


i have java library project contains dependency guava library. guava has near 11k methods count, , expect of users came android community. on android there limit count method, 65k...

but total count methods of library 11.400, library's code under 200 lines.

i able download , shrank guava jar using proguard, reducing count method number 1k. project needs contain reference shrank jar, instead reference remote repository guava hosted. but jar added project discard maven when published @ remote repository artifact, guava dependencies not resolved , application client crash.

guava advices not use proguard if “application” library, , leave users of library deal situation, using proguard in order shrank guava. don’t idea, because offer easy configuration solution.

as far know, output proguard provides sort of executable (jar, apk, etc), so, if shrank own library, final output jar, , jar, again, not published artifact, because discarded (i tried several times).

is there way of using proguard in own java library project , pass resulting output build chain in order published remote repository, not jar?

i’m using gradle way build project, @ point move maven 1 solves problem.

thanks.

do 1 of followings:

  1. use shrank version of guava separate maven artifact, publish it, , let lib depend on over other dependency
  2. do not shrink library , use multidex build - method solve 65k method limiation http://developer.android.com/tools/building/multidex.html

anyway ease of configuration should not use progruard on library simple reason: user have add dependency project anyway. , if in cases users start having classnotfound exception because have truncated of code didnt expect can used?

if programing android sooner or later bang proguard, , think sooner better.

so ease of configuration, rather suggest in documentation, if user wants avoid 65k limitation because library exceeding it, can use proguard in provided example configuration.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -