JRuby / Java integration, finding class dependencies for wrapped libraries

I’m working (along with a number of others in Ruby Mendicant
University’s fall program) on using JRuby to build Ruby wrappers around
Java libraries, and among other issues we’ve faced, a number of people
have been wondering whether there’s a standard practice for determining
class file / jar file dependencies for a given library. What techniques
do people use to be absolutely sure that a gem-based wrapper includes
all the files needed?

Thanks for the help.

Hi Chris,

On Thu, Sep 15, 2011 at 4:22 AM, Chris K. [email protected] wrote:

I’m working (along with a number of others in Ruby Mendicant
University’s fall program) on using JRuby to build Ruby wrappers around
Java libraries, and among other issues we’ve faced, a number of people
have been wondering whether there’s a standard practice for determining
class file / jar file dependencies for a given library. What techniques
do people use to be absolutely sure that a gem-based wrapper includes
all the files needed?

Congrats!

Perhaps, you can learn from pure Java Nokogiri’s implementation. Pure
Java Nokogiri has absolutely Ruby API and wraps Java libraries such as
Apache Xerces and NekoHTML. A technique used there is “JRuby
extension.” I wrote two blog post about that:

Implementation of pure Java Nokogiri is
https://github.com/tenderlove/nokogiri .

Also, json gem is a JRuby extension, so you should look at json, too.

Hope this helps,
-Yoko