RJB is used to launch anything Java-related when running under MRI. Obviously it's a requirement for Antwrap, but we also use it to do things like launch the javadoc tool (and scaladoc, and groovydoc), launch the Scala compiler (unless using FSC), etc. The advantages also aren't just avoiding a separate JVM launch. We use RJB's Java integration to launch a Java class (pre-compiled) which fiddles with classloaders and reflection to auto-detect test classes in a particular directory.
Of course, when running under JRuby, we switch to that mechanism instead of RJB. To tell the truth, we already feel the pain from RJB lagging behind JRuby's Java integration. Our internal framework lays an API on top of both mechanisms, and the fact that it must conform to the least common denominator (i.e. RJB) makes the integration much less pleasant all around. Daniel On Wed, Mar 3, 2010 at 6:54 AM, Charles Oliver Nutter <[email protected]>wrote: > On Tue, Mar 2, 2010 at 11:35 PM, Daniel Spiewak <[email protected]> > wrote: > > http://buildr.apache.org/rdoc/ > > > > Most of the internals are Rdoc'd with an eye toward extension builders. > > More information can be had by crawling through the following files: > > > > lib/buildr/java/cobertura.rb - Demonstrates a fairly simple extension, as > > well as how we're using Antwrap > > lib/buildr/scala/compiler.rb - A reasonably simple compiler, > demonstrating > > both the Compiler framework as well as unified JRuby/RJB Java dispatch > > lib/buildr/core/project.rb - The deep, dark innards of the Project > class. A > > lot of Buildr's magic (above and beyond Rake) happens here > > lib/buildr/core/util.rb - This file is mostly used to monkey-patch MRI, > Rake > > and even JRuby to get around certain issues we have been having > > > > Buildr's source is pretty well organized; things are pretty much where > you > > would expect them to be. If you have any questions, the dev list is the > > best place to ask. > > Thanks for the pointers, Daniel. I'll have a look. > > Is RJB only used for launching Ant stuff right now? As we do more to > help integrate Ruby and Java tools and processes in JRuby proper, RJB > is going to fall further and further behind in what it's able to > provide. > > - Charlie >
