Hi Roy, I'm also interested in this... So far what I've done is simply install JRuby, add all the Gems and rezip it for redistribution.
The .jar file approach looks interesting. I'll play with it a little bit and report if I manage to get anything working. alex On Tue, Mar 10, 2009 at 7:49 PM, Roy Tinker <[email protected]> wrote: > Hello, > > I am looking to find a way to package Buildr as a single Jar file, to be > run > alongside the jruby-complete-1.2.0RC2.jar file. Our current system (running > on Ant -- I'm trying to move to Buildr) downloads the executables (Jar and > Ant-XML) from source control and runs them on the JVM on a local machine > (which could be anywhere in the company). You can imagine how inconvenient > it would be to store all of 100 or more files associated with Buildr in > source control. It would be so much easier to have it all located inside a > single Jar file. > > Nick Sieger has found a way of packaging gems as jars for JRuby -- see > http://blog.nicksieger.com/articles/2009/01/10/jruby-1-1-6-gems-in-a-jar > > Has anyone done this before? -- or, does anyone have an idea of where I can > start? > > Here's what I have tried so far (with help from Nick's blog post) -- this > is > a transcript of my session. > > F:\jruby>java -jar jruby-complete-1.2.0RC2.jar -S gem list > > > > *** LOCAL GEMS *** > > > > rake (0.8.4) > > rspec (1.1.12) > > sources (0.0.1) > > > > F:\jruby>java -jar jruby-complete-1.2.0RC2.jar -S gem install -i ./buildr > > buildr --no-rdoc --no-ri > > JRuby limited openssl loaded. gem install jruby-openssl for full support. > > http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL > > Successfully installed rake-0.8.1 > > Successfully installed builder-2.1.2 > > Successfully installed net-ssh-2.0.4 > > Successfully installed net-sftp-2.0.1 > > Successfully installed rubyzip-0.9.1 > > Successfully installed highline-1.4.0 > > Successfully installed rubyforge-1.0.0 > > Successfully installed hoe-1.7.0 > > Successfully installed Antwrap-0.7.0-java > > Successfully installed rspec-1.1.5 > > Successfully installed xml-simple-1.0.11 > > Successfully installed archive-tar-minitar-0.5.2 > > Successfully installed jruby-openssl-0.2 > > Successfully installed buildr-1.3.3-java > > 14 gems installed > > > > F:\jruby>jar cf buildr-gem.jar -C buildr . > > > > F:\jruby>dir > > Volume in drive F is DATA > > Volume Serial Number is ____-____ > > > > Directory of F:\jruby > > > > 03/10/2009 07:41 PM <DIR> . > > 03/10/2009 07:41 PM <DIR> .. > > 03/06/2009 10:33 PM 279 build.rb > > 03/10/2009 07:40 PM <DIR> buildr > > *03/10/2009 07:42 PM 7,545,144 buildr-gem.jar* > > 03/09/2009 10:42 AM 10,279,665 jruby-complete-1.2.0RC2.jar > > 3 File(s) 17,825,088 bytes > > 3 Dir(s) 156,998,463,488 bytes free > > > > F:\jruby>java -jar jruby-complete-1.2.0RC2.jar -rbuildr-gem.jar -S gem > list > > > > *** LOCAL GEMS *** > > > > Antwrap (0.7.0) > > archive-tar-minitar (0.5.2) > > builder (2.1.2) > > buildr (1.3.3) > > highline (1.4.0) > > hoe (1.7.0) > > jruby-openssl (0.2) > > net-sftp (2.0.1) > > net-ssh (2.0.4) > > rake (0.8.4, 0.8.1) > > rspec (1.1.12, 1.1.5) > > rubyforge (1.0.0) > > rubyzip (0.9.1) > > sources (0.0.1) > > xml-simple (1.0.11) > > > > F:\jruby>java -jar jruby-complete-1.2.0RC2.jar -rbuildr-gem.jar -S buildr > > jruby: No such file, directory, or command -- buildr > > > > F:\jruby>java -jar jruby-complete-1.2.0RC2.jar -rbuildr-gem.jar build.rb > > build.rb:3:in `require': no such file to load -- buildr (LoadError) > > from build.rb:3 > > > > F:\jruby>java -jar jruby-complete-1.2.0RC2.jar -rbuildr-gem.jar -S irb > > irb(main):002:0> require 'rubygems' > > => true > > irb(main):003:0> require 'buildr' > > LoadError: no such file to load -- buildr > > from > > > file:/F:/jruby/jruby-complete-1.2.0RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31: > > in `require' > > from > > > file:/F:/jruby/jruby-complete-1.2.0RC2.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31: > > in `require' > > from (irb):4 > > > > > Thanks, > Roy >
