Skip to content

Commit

Permalink
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tool/truffle/jruby_truffle_runner/lib/jruby+truffle_runner.rb
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
require 'yaml'
require 'fileutils'
require 'shellwords'
require 'pathname'

# TODO (pitr 01-Sep-2015): add pre stored run options combinations like -S irb, -I test

@@ -42,7 +43,7 @@ class JRubyTruffleRunner
jruby_truffle_path: ['--jruby-truffle-path PATH', 'Path to JRuby+Truffle bin/jruby', assign_new_value,
'../jruby/bin/jruby'],
graal_path: ['--graal-path PATH', 'Path to Graal', assign_new_value, '../graalvm-jdk1.8.0/bin/java'],
mock_load_path: ['--mock-load-path PATH', 'Root path for all mocks/monkey-patches which is prepended in $:',
mock_load_path: ['--mock-load-path PATH', 'Path of mocks & monkey-patches (prepended in $:, relative to --truffle_bundle_path)',
assign_new_value, 'mocks']
},
setup: {
@@ -58,7 +59,6 @@ class JRubyTruffleRunner
debug: ['-d', '--debug', 'JVM remote debugging', assign_new_value, false],
require: ['-r', '--require FILE', 'Files to require, same as Ruby\'s -r', add_to_array, []],
load_path: ['-I', '--load-path LOAD_PATH', 'Paths to add to load path, same as Ruby\'s -I', add_to_array, []],
# TODO (pitr 01-Sep-2015): add option for prepended load paths to be able to replace ugly echo in the yaml file
jexception: ['--jexception', 'print Java exceptions', assign_new_value, false]
},
clean: {
@@ -243,7 +243,7 @@ def eval_yaml_strings(value)

def subcommand_setup(rest)
bundle_path = File.expand_path @options[:global][:truffle_bundle_path]
bundle_installed = execute_cmd 'command -v bundle 1>&2 2>/dev/null', fail: false
bundle_installed = execute_cmd 'command -v bundle 2>/dev/null 1>&2', fail: false

execute_cmd 'gem install bundler' unless bundle_installed

@@ -275,8 +275,11 @@ def subcommand_setup(rest)
end

def subcommand_run(rest)
core_load_path = Pathname("#{@options[:global][:jruby_truffle_path]}/../../truffle/src/main/ruby").
relative_path_from(Pathname('.')).to_s

cmd_options = [
('-X+T' unless @options[:run][:test]),
*(['-X+T', "-Xtruffle.core.load_path=#{core_load_path}"] unless @options[:run][:test]),
(format(@options[:global][:debug_option], @options[:global][:debug_port]) if @options[:run][:debug]),
('-Xtruffle.exceptions.print_java=true' if @options[:run][:jexception]),
'-r', "./#{@options[:global][:truffle_bundle_path]}/bundler/setup.rb",

0 comments on commit 34b8eee

Please sign in to comment.