buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David (JIRA)" <>
Subject [jira] Created: (BUILDR-567) Enable Ant using JRuby's Ant integration
Date Sun, 30 Jan 2011 06:47:43 GMT
Enable Ant using JRuby's Ant integration

                 Key: BUILDR-567
             Project: Buildr
          Issue Type: Improvement
          Components: JRuby
    Affects Versions: 1.4.4
            Reporter: David

Buildr does not work with JRuby's Ant integration. Since Antwrap hasn't been updated in almost
three years, I tried to follow the JRuby + Ant examples in the article linked at the end.
This simple script works using just jruby:

# test.rb
require 'ant' # Use JRuby Ant integration


But when I try accessing ant from Buildr, I keep getting a TypeError that complains about
Ant not being a class. This buildfile:

# buildfile - buildr sandbox
GROUP = "buildr-sandbox"

require 'ant'

repositories.remote << ""

desc "The Buildr-sandbox project"

define "buildr-sandbox" do
  project.version = VERSION_NUMBER = GROUP

  package :jar

Results in this error:

Buildr aborted!
TypeError : Ant is not a class
.../jruby/lib/ruby/site_ruby/shared/ant.rb:3:in `(root)'
org/jruby/ `require'
.../jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
.../jruby/lib/ruby/site_ruby/shared/ant.rb:6:in `(root)'
org/jruby/ `load'
.../buildr-sandbox/buildfile:412:in `raw_load_buildfile'
.../jruby-1.6.0.RC1/lib/ruby/gems/1.8/gems/buildr-1.4.4-java/bin/buildr:19:in `(root)'
org/jruby/ `load'

I think it's because $JRUBY_HOME/lib/ruby/site_ruby/shared/ant.rb defnes Ant as a class while
lib/buildr/java/ant.rb, which runs first (I think) defines it as a module.

The article:

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message