summaryrefslogtreecommitdiff
path: root/lib/rake/javaextensiontask.rb
diff options
context:
space:
mode:
authorLuis Lavena <luislavena@gmail.com>2009-12-07 00:45:08 -0300
committerLuis Lavena <luislavena@gmail.com>2009-12-07 00:45:08 -0300
commit49045e680912d9ac5640c1f867aa91598152defb (patch)
tree219365a00c0698a4788d931920af279691700e80 /lib/rake/javaextensiontask.rb
parent05a836dd2f57bed30e9e9f398727dc1bf3af7db8 (diff)
downloadrake-compiler-49045e680912d9ac5640c1f867aa91598152defb.tar.gz
Make Java class path work on non-JRuby.
Diffstat (limited to 'lib/rake/javaextensiontask.rb')
-rw-r--r--lib/rake/javaextensiontask.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rake/javaextensiontask.rb b/lib/rake/javaextensiontask.rb
index f43b077..3ea71f5 100644
--- a/lib/rake/javaextensiontask.rb
+++ b/lib/rake/javaextensiontask.rb
@@ -189,6 +189,7 @@ execute the Rake compilation task using the JRuby interpreter.
# of ways to discover the Java classpath correctly.
#
def java_classpath_arg(*args)
+ jruby_cpath = nil
if RUBY_PLATFORM =~ /java/
begin
cpath = Java::java.lang.System.getProperty('java.class.path').split(File::PATH_SEPARATOR)
@@ -199,7 +200,8 @@ execute the Rake compilation task using the JRuby interpreter.
end
unless jruby_cpath
jruby_cpath = ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] &&
- FileList["#{ENV['JRUBY_HOME']}/lib/*.jar"].join(File::PATH_SEPARATOR)
+ Dir.glob("#{File.expand_path(ENV['JRUBY_HOME'])}/lib/*.jar").
+ join(File::PATH_SEPARATOR)
end
raise "JRUBY_HOME or JRUBY_PARENT_CLASSPATH are not set" unless jruby_cpath
jruby_cpath += File::PATH_SEPARATOR + args.join(File::PATH_SEPARATOR) unless args.empty?