forked from jruby/jruby
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjruby_eclipse
executable file
·46 lines (38 loc) · 1.12 KB
/
jruby_eclipse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/ruby
# A JRuby launcher, in Ruby, and using the class files from Eclipse
# Currently needs the core and stdlib jar, so build them again when they change.
JRUBY = File.expand_path('../..', __FILE__)
TRUFFLEJAR = "#{Dir.home}/.m2/repository/com/oracle/truffle/0.7/truffle-0.7.jar"
java = ENV["JAVACMD"] || "java"
bootclasspath = "-Xbootclasspath/a"
[
"#{JRUBY}/lib/jruby.jar",
TRUFFLEJAR,
"#{JRUBY}/lib/jruby-stdlib-9.0.0.0-SNAPSHOT.jar",
"#{JRUBY}/truffle/build.eclipse",
"#{JRUBY}/truffle/src/main/ruby"
].each { |path| bootclasspath << ":#{path}" }
args = [java]
args << "-Djffi.boot.library.path=#{JRUBY}/lib/jni"
args << bootclasspath
args << "-Djruby.home=#{JRUBY}"
args << "-Djruby.lib=#{JRUBY}/lib"
args << "-Djruby.script=jruby"
args << "-Djruby.shell=/bin/sh"
java_flags = []
rest = []
ARGV.each { |arg|
if arg.start_with?("-Xmx") or arg == "-ea"
java_flags << arg
elsif arg.start_with?("-J")
java_flags << arg[2..-1]
elsif arg.start_with?("-Xtruffle.")
java_flags << "-Djruby.#{arg[2..-1]}"
else
rest << arg
end
}
args += java_flags
args << "org.jruby.Main"
args += rest
exec(*args)