R
Robert Mischke
I've come across this problem several times: What tools can I use to
extract all class files that are in the call graph of my main method,
or of a given set of files?
Example 1:
Imagine an application with all its classes in com.foo.app.* . Some of
these classes import classes from com.foo.lib.* . Now I want to export
all classes from com.foo.app.* and com.foo.lib.* that are imported
directly or indirectly by my (specified) main class (say
com.foo.app.Main).
Somehow I expect this to be a standard task, but haven't found support
for it yet. On the other hand, I don't see any theoretical problems
with this, so I wonder how this can be done.
Example 2:
I want to build a standalone JFace application. Unfortunately, since
Eclipse 3.0, there are some dependencies to consider: runtime.jar,
osgi.jar and core.jar. I now want to compress these into a jar that
contains all classes of JFace (easy) and all indirectly referenced
classes from the other jars (the tricky part).
I already tried to achieve this with ProGuard obfuscator (with
-dontobfuscate, -keep *, etc), but didn't get a result that I could
compile an application against; there were always some methods and
classes missing that some class needed. I might finally get this to
work, but somehow it feels like a clumsy way to go. Isn't there a
better way to do this?
Thanks,
Robert
extract all class files that are in the call graph of my main method,
or of a given set of files?
Example 1:
Imagine an application with all its classes in com.foo.app.* . Some of
these classes import classes from com.foo.lib.* . Now I want to export
all classes from com.foo.app.* and com.foo.lib.* that are imported
directly or indirectly by my (specified) main class (say
com.foo.app.Main).
Somehow I expect this to be a standard task, but haven't found support
for it yet. On the other hand, I don't see any theoretical problems
with this, so I wonder how this can be done.
Example 2:
I want to build a standalone JFace application. Unfortunately, since
Eclipse 3.0, there are some dependencies to consider: runtime.jar,
osgi.jar and core.jar. I now want to compress these into a jar that
contains all classes of JFace (easy) and all indirectly referenced
classes from the other jars (the tricky part).
I already tried to achieve this with ProGuard obfuscator (with
-dontobfuscate, -keep *, etc), but didn't get a result that I could
compile an application against; there were always some methods and
classes missing that some class needed. I might finally get this to
work, but somehow it feels like a clumsy way to go. Isn't there a
better way to do this?
Thanks,
Robert