Proguard for shrinking JAR not correctly picking up dependent classes -
i newbie using proguard (which seems immensely useful!). wish create minimal jar (without obfuscation whatsover) using starting point (say public interface) , hoping proguard pick dependent classes transitively. dependent class seems lacking private members, public getter/setters , annotations constructor , tostring method available. concretely, specialservice interface refers specialobject (and maybe many others). wondering if possible mention specialservice keep class , dependent (non-library)c lasses (with of attributes - no obfuscation or optimization) should pulled in output jar.
<options> <option>-keepattributes</option> <option>-keep @javax.ws.rs.path public class com.kilo.specialservice { private public protected *;}</option> </options>
i have tried configurations, doesn't seem work.
specialservice.java:
@get @path("somecomplexobjectswithintinputs") list<specialobject> getsomecomplexobjectswithintinputs( @queryparam("ids") list<integer> ids);
specialobject.java
public class specialobject { private string name; private integer id; private date date; public specialobject() { } public specialobject(string name, integer id, date date) { this.name = name; this.id = id; this.date = date; } public string getname() { return name; } public integer getid() { return id; } public date getdate() { return date; } public string getfoo() { return "foo"; } public void setname(string name) { this.name = name; } public void setid(integer id) { this.id = id; } public void setdate(date date) { this.date = date; } @override public string tostring() { return "specialobject [name=" + name + ", id=" + id + ", date=" + date + "]"; }
output specialobject.java:
/* */ public class specialobject /* */ { /* */ public string tostring() /* */ { /* 56 */ return "specialobject [name=" + null + ", id=" + null + ", date=" + null + "]"; /* */ } /* */ }
thanks in advance!
i have added sample setup @ https://github.com/kilokahn/proguard-tester/blob/master/proguard-tester-parent/proguard-tester-rs-api/pom.xml if wishes play around
figured out simple config this. stupid me!
<option>-keepclassmembers class * { *;}</option>
updated setup reflect this.
Comments
Post a Comment