Skip to content

Commit

Permalink
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
require 'fileutils'
require 'digest/sha1'

GRAALVM_VERSION = "0.10"
GRAALVM_VERSION = "0.11"

JRUBY_DIR = File.expand_path('../..', __FILE__)

@@ -37,22 +37,24 @@ def self.truffle_version
end
end

def self.find_graal
graal_locations = [
ENV['GRAAL_BIN'],
ENV["GRAAL_BIN_#{mangle_for_env(git_branch)}"],

This comment has been minimized.

Copy link
@chrisseaton

chrisseaton Apr 24, 2016

Contributor

What's wrong with the GRAAL_BIN_TRUFFLE_HEAD etc variables? I used those so that I could always find the right Graal for the right branch. What do you do instead?

This comment has been minimized.

Copy link
@eregon

eregon Apr 25, 2016

Author Member

Ah, sorry I didn't mean to remove them, I'll add them back. I use an explicit GRAAL_BIN for truffle-head and rely on discovery for master.

"GraalVM-#{GRAALVM_VERSION}/jre/bin/javao",
"../GraalVM-#{GRAALVM_VERSION}/jre/bin/javao",
"../../GraalVM-#{GRAALVM_VERSION}/jre/bin/javao",
].compact.map { |path| File.expand_path(path, JRUBY_DIR) }
def self.graal_locations
from_env = ENV['GRAAL_BIN']
yield from_env if from_env

not_found = -> {
raise "couldn't find graal - download it as described in https://github.com/jruby/jruby/wiki/Downloading-GraalVM and extract it into the JRuby repository or parent directory"
rel_java_bin = "bin/java" # "jre/bin/javao"
%w[dk re].each { |kind|
["", "../", "../../"].each { |prefix|
path = "#{prefix}graalvm-#{GRAALVM_VERSION}-#{kind}/#{rel_java_bin}"
yield File.expand_path(path, JRUBY_DIR)
}
}
end

graal_locations.find(not_found) do |location|
File.executable?(location)
def self.find_graal
graal_locations do |location|
return location if File.executable?(location)
end
raise "couldn't find graal - download it as described in https://github.com/jruby/jruby/wiki/Downloading-GraalVM and extract it into the JRuby repository or parent directory"
end

def self.find_graal_js

0 comments on commit a549aba

Please sign in to comment.