Usually by providing -injars and -outjars to progaurd , we can generate obfuscated jar file of filtered classes from -injars.
is there any way in gradle android build by using proguardFile attribute, to generated obfuscated jar file of filtered classes from group of project classes . These filtered jar files are in addition to gradle android build binary.
My requirement of generating individual obfuscated jar files based on few selected class files from single library project is achieved with below way. These individual jar files are in addition to final android binary i.e, .aar file.
Debug : 1. During android build, gradle moves all the compiled java files to /build/intermediates/javac/debug/compileDebugJavaWithJavac/classes folder.
In proguard file I have given -injars as above folder and -outjars as my custom path with filters.
Using 'proguardFile' attribute I have passed proguard file to build.gradle
All the individual jar files specified using -injars and -outjars would be obfuscated and will be placed in -outjars path
Eg :
In debug mode :
-injars 'D:\projectname\build\intermediates\javac\debug\compileDebugJavaWithJavac\classes'(**.class)
-outjars 'D:\projectname\build\intermediates\transforms\proguard\debug\1.jar'(com/ui/tab/TabWidget.class,com/ui/Tab.class)
-injars 'D:\projectname\build\intermediates\javac\debug\compileDebugJavaWithJavac\classes'(**.class)
-outjars 'D:\projectname\build\intermediates\transforms\proguard\debug\1.jar'(com/ui/CollapsibleWidget.class)