summaryrefslogtreecommitdiff
path: root/lib/rake
diff options
context:
space:
mode:
authorKouhei Sutou <kou@cozmixng.org>2018-08-29 15:42:47 +0900
committerGitHub <noreply@github.com>2018-08-29 15:42:47 +0900
commit947abfc64b4c1a03762b5bbe1d279fd50b2935c4 (patch)
treead965d2e26b4bbe514c7e1047925aa21eb3d7f3c /lib/rake
parent5ab590d4b74e0bf6831d414b9f7f3f61f0b6fbbe (diff)
parentd3ff502526707f7495a6eba5b6ccdb3513b64f8a (diff)
downloadrake-compiler-947abfc64b4c1a03762b5bbe1d279fd50b2935c4.tar.gz
Merge pull request #147 from prashantvithani/fix-classpath
Use 'libdir' of rbconfig to get jruby classpath Patch by Prashant Vithani. Thanks!!!
Diffstat (limited to 'lib/rake')
-rw-r--r--lib/rake/javaextensiontask.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/rake/javaextensiontask.rb b/lib/rake/javaextensiontask.rb
index c862432..d467303 100644
--- a/lib/rake/javaextensiontask.rb
+++ b/lib/rake/javaextensiontask.rb
@@ -211,11 +211,13 @@ execute the Rake compilation task using the JRuby interpreter.
end
end
unless jruby_cpath
- jruby_cpath = ENV['JRUBY_PARENT_CLASSPATH'] || ENV['JRUBY_HOME'] &&
- Dir.glob("#{File.expand_path(ENV['JRUBY_HOME'])}/lib/*.jar").
- join(File::PATH_SEPARATOR)
+ require 'rbconfig'
+ libdir = RbConfig::CONFIG['libdir']
+ if libdir.start_with? "classpath:"
+ raise 'Cannot build with jruby-complete'
+ end
+ jruby_cpath = File.join(libdir, "jruby.jar")
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?
jruby_cpath ? "-cp \"#{jruby_cpath}\"" : ""
end