gradle - How to disable Proguard settings for an external dependency jar? -
my project consists of 2 modules - application , library. library, in turn, includes (via "compile") jar (whose classes referenced directly in application well).
questions:
- how should configure proguard run on app, on library not on included jar?
- should put proguard settings in build.gradle library?
- should put respect jar in build.gradle app?
currently, have in app:
buildtypes { release { debuggable false zipalign true runproguard true proguardfile 'proguard-rules.txt' proguardfile getdefaultproguardfile('proguard-android-optimize.txt') signingconfig signingconfigs.release
it's not possible @ moment exclude dependency when running proguard.
you should proguard library if want obfuscate parts of it. useful if want offer part of public api. definitively not want remove dead code, since don't know used or not.
on app side, don't need put special, unless library code requires not obfuscate specific class. if that's case should publish library app uses automatically. there's sample called
libproguardconsumerfilesshows how usingconsumerproguardfilesproperties. include proguard rule file in library packaging used whomever consumes library.
Comments
Post a Comment