public
Rubygem
Description: Apache Buildr
Homepage: http://incubator.apache.org/buildr
Clone URL: git://github.com/vic/buildr.git
Search Repo:
BUILDR-66

Applied Nick's patch.
If buildr if running on JRuby don't download jruby-complete again, just 
use the
currently installed jruby jars.


git-svn-id: https://svn.apache.org/repos/asf/incubator/buildr/trunk@653601 
13f79535-47bb-0310-9956-ffa450edef68
vic (author)
Mon May 05 14:01:10 -0700 2008
commit  23d85f86e473e2339ef436f60e44a40403936543
tree    7dcca3b46bd1e32c26d0adae93b01106070877d0
parent  5393b44e8181067dc07df6b44d3dc98e85e249fc
...
49
50
51
52
 
53
54
55
...
59
60
61
62
 
 
 
 
63
64
65
66
...
77
78
79
 
80
 
81
82
83
...
86
87
88
89
90
91
92
...
94
95
96
97
 
98
99
100
101
...
113
114
115
116
117
118
119
120
121
122
123
124
125
 
126
127
128
...
49
50
51
 
52
53
54
55
...
59
60
61
 
62
63
64
65
66
67
68
69
...
80
81
82
83
84
85
86
87
88
...
91
92
93
 
94
95
96
...
98
99
100
 
101
102
103
104
105
...
117
118
119
 
 
 
 
 
 
120
121
122
 
123
124
125
126
0
@@ -49,7 +49,7 @@
0
       project.task('test:resources').tap do |res|
0
         res.send :associate_with, project, bdd_dir
0
         res.filter.clear
0
- project.path_to(:source, bdd_dir, :resources).tap { |dir| resources.from dir if File.exist?(dir) }
0
+ project.path_to(:source, bdd_dir, :resources).tap { |dir| reses.from dir if File.exist?(dir) }
0
       end
0
       super
0
     end
0
@@ -59,7 +59,10 @@
0
     include TestFramework::JavaBDD
0
     self.lang = :ruby
0
 
0
- REQUIRES = ['org.jruby:jruby-complete:jar:1.1']
0
+
0
+ REQUIRES = []
0
+ REQUIRES.unshift 'org.jruby:jruby-complete:jar:1.1.1' unless RUBY_PLATFORM =~ /java/
0
+
0
     TESTS_PATTERN = [ /_spec.rb$/ ]
0
     OPTIONS = [:properties, :java_args]
0
 
0
0
@@ -77,7 +80,9 @@
0
 
0
     def run(tests, dependencies) #:nodoc:
0
       cmd_options = task.options.only(:properties, :java_args)
0
+ dependencies.push *Dir.glob(File.join(jruby_home, "lib/*.jar")) if RUBY_PLATFORM =~ /java/
0
       cmd_options.update :classpath => dependencies, :project => task.project
0
+
0
       # TODO: Setting up JRuby is something to do before running Buildr.
0
       #install_gems(cmd_options)
0
 
0
@@ -86,7 +91,6 @@
0
       ENV['CI_REPORTS'] = report_dir
0
 
0
       jruby("-Ilib", "-S", "spec",
0
- #"--require", gem_path(task.project, "ci_reporter", "lib/ci/reporter/rake/rspec_loader"),
0
       "--require", "ci/reporter/rake/rspec_loader",
0
       "--format", "CI::Reporter::RSpecDoc", tests,
0
       cmd_options.merge({:name => "RSpec"}))
0
@@ -94,7 +98,7 @@
0
     end
0
 
0
     private
0
- def jruby_home(project)
0
+ def jruby_home
0
       @jruby_home ||= RUBY_PLATFORM =~ /java/ ? Config::CONFIG['prefix'] : File.expand_path(".jruby", ENV['HOME'])
0
     end
0
 
0
0
@@ -113,16 +117,10 @@
0
       java_args << {} unless Hash === args.last
0
       cmd_options = java_args.last
0
       project = cmd_options.delete(:project)
0
- if RUBY_PLATFORM =~ /java/
0
- # when run from within JRuby, use jars in launched-JRuby's classpath rather than the
0
- # stated dependency
0
- cmd_options[:classpath].delete_if {|e| File.basename(e) =~ /^jruby-complete-.*\.jar$/ }
0
- cmd_options[:classpath].unshift *(java.lang.System.getProperty("java.class.path").split(File::PATH_SEPARATOR))
0
- end
0
       cmd_options[:java_args] ||= []
0
       cmd_options[:java_args] << "-Xmx512m" unless cmd_options[:java_args].detect {|a| a =~ /^-Xmx/}
0
       cmd_options[:properties] ||= {}
0
- cmd_options[:properties]["jruby.home"] = jruby_home(project)
0
+ cmd_options[:properties]["jruby.home"] = jruby_home
0
       Java::Commands.java(*java_args)
0
     end
0
 

Comments

    No one has commented yet.