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: 420f92196e2d
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fbf9427e118f
Choose a head ref
  • 3 commits
  • 1 file changed
  • 1 contributor

Commits on Mar 19, 2015

  1. [Truffle] JT: Do not specify full path.

    * Otherwise it prevents use of multiple checkouts.
    eregon committed Mar 19, 2015
    Copy the full SHA
    c202678 View commit details
  2. Copy the full SHA
    2467f36 View commit details
  3. [Truffle] JT: Move paths inside the methods using them.

    * Otherwise we have silly dependencies with these constants.
    eregon committed Mar 19, 2015
    Copy the full SHA
    fbf9427 View commit details
Showing with 34 additions and 18 deletions.
  1. +34 −18 tool/jt.rb
52 changes: 34 additions & 18 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@

# A workflow tool for JRuby+Truffle development

# Recommended: function jt { ruby PATH/TO/jruby/tool/jt.rb $@; }
# Recommended: function jt { ruby tool/jt.rb $@; }

require 'fileutils'
require 'digest/sha1'
@@ -18,11 +18,34 @@

module Utilities

def self.graal_version
File.foreach("#{JRUBY_DIR}/truffle/pom.rb").each do |line|
if /jar 'com.oracle:truffle:(\d+\.\d+(?:-SNAPSHOT)?)'/ =~ line
break $1
end
end
end

def self.find_graal
base_graal_path = if graal_version.include?('SNAPSHOT')
'basic-graal/jdk1.8.0_05/product'
else
'graalvm-jdk1.8.0'
end

graal_locations = [
ENV["GRAAL_BIN_#{mangle_for_env(git_branch)}"],
ENV['GRAAL_BIN'],
"#{base_graal_path}/bin/java",
"../#{base_graal_path}/bin/java",
"../../#{base_graal_path}/bin/java",
].compact.map { |path| File.expand_path(path, JRUBY_DIR) }

not_found = -> {
raise "couldn't find graal - download it from http://lafo.ssw.uni-linz.ac.at/graalvm/ and extract it into the JRuby repository or parent directory"
}
GRAAL_LOCATIONS.find(not_found) do |location|

graal_locations.find(not_found) do |location|
File.executable?(location)
end
end
@@ -32,7 +55,7 @@ def self.git_branch
end

def self.mangle_for_env(name)
name.upcase.gsub('-', '_')
name.upcase.tr('-', '_')
end

def self.find_graal_mx
@@ -63,10 +86,17 @@ def self.ensure_igv_running
end

def self.find_bench
bench_locations = [
ENV['BENCH_DIR'],
'bench9000',
'../bench9000'
].compact.map { |path| File.expand_path(path, JRUBY_DIR) }

not_found = -> {
raise "couldn't find bench9000 - clone it from https://github.com/jruby/bench9000.git into the JRuby repository or parent directory"
}
BENCH_LOCATIONS.find(not_found) do |location|

bench_locations.find(not_found) do |location|
Dir.exist?(location)
end
end
@@ -75,20 +105,6 @@ def self.jruby_version
File.read("#{JRUBY_DIR}/VERSION").strip
end

GRAAL_LOCATIONS = [
ENV["GRAAL_BIN_#{mangle_for_env(git_branch)}"],
ENV['GRAAL_BIN'],
'graalvm-jdk1.8.0/bin/java',
'../graalvm-jdk1.8.0/bin/java',
'../../graal/graalvm-jdk1.8.0/bin/java'
].compact.map { |path| File.expand_path(path, JRUBY_DIR) }

BENCH_LOCATIONS = [
ENV['BENCH_DIR'],
'bench9000',
'../bench9000'
].compact.map { |path| File.expand_path(path, JRUBY_DIR) }

end

module ShellUtils