monstadubois7 / jarjar

Automatically exported from code.google.com/p/jarjar
0 stars 0 forks source link

[patch] New "check" command to check for missing dependencies #47

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
jarjar's find command outputs dependencies but excludes those where the target 
cannot be found in its classpath.

I'd like a new command that looks for such dependencies, as they may be 
significant errors resulting in runtime NoClassDefFoundError.

The attached patch adds a "check" command which is similar to "find" but 
outputs lines of the form

foo.jar!org/example/foo/MyClass -> org/example/bar/TheirClass

for each reference in cp1 that cannot be resolved in cp2.

It was a fairly natural adaptation of "find" so I'd like it to be considered 
for inclusion in a future jarjar release.

I have some additional plans:
  (1) Look into adding tests for this
  (2) Investigate exposing an ant task for "check"
  (3) Consider adding some form of exemption list for optional dependencies that are known to be missing

(2) and (3) could be done within jarjar or as part of my calling code, so I'd 
welcome any opinion here.

Original issue reported on code.google.com by matt%hil...@gtempaccount.com on 17 Mar 2011 at 5:36

Attachments: