Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f1b7d5b247f0
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fd47b9dd35b4
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jul 10, 2015

  1. [Truffle] Add a tool to run jruby directly from Eclipse class files.

    * No need to build any jar as long as core/ does not change!
    eregon committed Jul 10, 2015
    Copy the full SHA
    9c96854 View commit details
  2. Copy the full SHA
    fd47b9d View commit details
Showing with 51 additions and 1 deletion.
  1. +44 −0 tool/jruby_eclipse
  2. +7 −1 tool/jt.rb
44 changes: 44 additions & 0 deletions tool/jruby_eclipse
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/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]
else
rest << arg
end
}

args += java_flags
args << "org.jruby.Main"
args += rest

exec(*args)
8 changes: 7 additions & 1 deletion tool/jt.rb
Original file line number Diff line number Diff line change
@@ -270,7 +270,13 @@ def run(*args)
jruby_args += %w[-J-G:Dump=TrufflePartialEscape]
end

raw_sh env_vars, "#{JRUBY_DIR}/bin/jruby", *jruby_args, *args
if ENV["JRUBY_ECLIPSE"] == "true"
jruby_bin = "#{JRUBY_DIR}/tool/jruby_eclipse"
else
jruby_bin = "#{JRUBY_DIR}/bin/jruby"
end

raw_sh env_vars, jruby_bin, *jruby_args, *args
end
alias ruby run