Skip to content

Commit 1d8d56c

Browse files
committed
Support JDK 19 in jt
1 parent ad2d6d9 commit 1d8d56c

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

tool/jt.rb

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
# Expand GEM_HOME relative to cwd so it cannot be misinterpreted later.
6464
ENV['GEM_HOME'] = File.expand_path(ENV['GEM_HOME']) if ENV['GEM_HOME']
6565

66+
JDK_VERSIONS = [11, 17, 19]
67+
6668
MRI_TEST_RELATIVE_PREFIX = 'test/mri/tests'
6769
MRI_TEST_PREFIX = "#{TRUFFLERUBY_DIR}/#{MRI_TEST_RELATIVE_PREFIX}"
6870
MRI_TEST_CEXT_DIR = "#{MRI_TEST_PREFIX}/cext-c"
@@ -748,7 +750,7 @@ def help
748750
The default can be changed with `export RUBY_BIN=RUBY_SELECTOR`
749751
--silent|-q Does not print the command and which Ruby is used
750752
--verbose|-v Print more details and commands
751-
--jdk Specifies which version of the JDK should be used: 11 (default) or 17
753+
--jdk Specifies which version of the JDK should be used: #{JDK_VERSIONS.join(' or ')}
752754
753755
jt build [graalvm|parser|options|core-symbols] ... by default it builds graalvm
754756
jt build parser|options|core-symbols
@@ -860,7 +862,7 @@ def help
860862
OPENSSL_PREFIX Where to find OpenSSL headers and libraries
861863
ECLIPSE_EXE Where to find Eclipse
862864
SYSTEM_RUBY The Ruby interpreter to run 'jt' itself, when using 'bin/jt'
863-
JT_JDK The default JDK version to use: 11 (default) or 17
865+
JT_JDK The default JDK version to use: #{JDK_VERSIONS.join(' or ')}
864866
JT_ENV The default value for 'jt build --env JT_ENV' and for 'jt --use JT_ENV'
865867
JT_PROFILE_SUBCOMMANDS Print the time each subprocess takes on stderr
866868
JT_SPECS_COMPILATION Controls whether Graal will be used when running specs (default: 'true'). Only affects JVM with Graal. Set to 'false' to disable for running specs faster when developing with jvm-ce.
@@ -2231,13 +2233,8 @@ def install(name, *options)
22312233
end
22322234

22332235
private def install_jvmci(download_message, ee, jdk_version: @jdk_version)
2234-
if jdk_version == 11
2235-
jdk_name = ee ? 'labsjdk-ee-11' : 'labsjdk-ce-11'
2236-
elsif jdk_version == 17
2237-
jdk_name = ee ? 'labsjdk-ee-17' : 'labsjdk-ce-17'
2238-
else
2239-
raise "Unknown JDK version: #{jdk_version}"
2240-
end
2236+
raise "Unknown JDK version: #{jdk_version}" unless JDK_VERSIONS.include?(jdk_version)
2237+
jdk_name = ee ? "labsjdk-ee-#{jdk_version}" : "labsjdk-ce-#{jdk_version}"
22412238

22422239
java_home = "#{JDKS_CACHE_DIR}/#{jdk_name}-#{jvmci_version}"
22432240
unless File.directory?(java_home)
@@ -3097,7 +3094,7 @@ def process_pre_args(args)
30973094
end
30983095
end
30993096

3100-
raise "Invalid JDK version: #{@jdk_version}" unless [11, 17].include?(@jdk_version)
3097+
raise "Invalid JDK version: #{@jdk_version}" unless JDK_VERSIONS.include?(@jdk_version)
31013098

31023099
if needs_rebuild
31033100
rebuild

0 commit comments

Comments
 (0)