@@ -256,7 +256,7 @@ def ruby_launcher
256
256
File . directory? ( @ruby_name ) ? "#{ @ruby_name } /bin/ruby" : @ruby_name
257
257
else
258
258
graalvm = "#{ TRUFFLERUBY_DIR } /mxbuild/truffleruby-#{ @ruby_name } "
259
- "#{ graalvm } /languages/ruby/ bin/ruby"
259
+ "#{ graalvm } /bin/ruby"
260
260
end
261
261
262
262
raise "The Ruby executable #{ ruby_launcher } does not exist" unless File . exist? ( ruby_launcher )
@@ -268,7 +268,6 @@ def ruby_launcher
268
268
unless @silent
269
269
shortened_path = @ruby_launcher . sub ( %r[^#{ Regexp . escape TRUFFLERUBY_DIR } /] , '' )
270
270
shortened_path = shortened_path . sub ( %r[/bin/(ruby|truffleruby)$] , '' )
271
- shortened_path = shortened_path . sub ( %r[/languages/ruby$] , '' ) if graalvm_home
272
271
tags = [ *( 'Interpreted' if truffleruby? && !truffleruby_compiler? ) ,
273
272
truffleruby? ? 'TruffleRuby' : 'a Ruby' ,
274
273
*( 'with Native' if truffleruby_native_built? ) ,
@@ -287,18 +286,7 @@ def ruby_home
287
286
require_ruby_launcher!
288
287
File . expand_path ( '../..' , @ruby_launcher_realpath )
289
288
end
290
-
291
- def graalvm_home
292
- up = if ruby_home . end_with? ( 'jre/languages/ruby' )
293
- 3
294
- elsif ruby_home . end_with? ( 'languages/ruby' )
295
- 2
296
- else
297
- nil # standalone
298
- end
299
- return nil unless up
300
- File . expand_path ( ( [ '..' ] * up ) . join ( '/' ) , ruby_home )
301
- end
289
+ alias_method :'ruby-home' , :ruby_home
302
290
303
291
def truffleruby!
304
292
raise 'This command requires TruffleRuby.' unless truffleruby?
@@ -350,8 +338,8 @@ def truffleruby_compiler?
350
338
return @truffleruby_compiler = false unless truffleruby?
351
339
return @truffleruby_compiler = true if truffleruby_native_built?
352
340
353
- # Detect if the compiler is present by reading the $graalvm_home /release file
354
- @truffleruby_compiler = File . readlines ( "#{ graalvm_home || ruby_home } /release" ) . grep ( /^COMMIT_INFO=/ ) . any? do |line |
341
+ # Detect if the compiler is present by reading the $ruby_home /release file
342
+ @truffleruby_compiler = File . readlines ( "#{ ruby_home } /release" ) . grep ( /^COMMIT_INFO=/ ) . any? do |line |
355
343
line . include? ( '"compiler":' ) || line . include? ( "'compiler':" )
356
344
end
357
345
end
@@ -898,7 +886,7 @@ def help
898
886
jt sync continuously synchronize changes from the Ruby source files to the GraalVM build
899
887
jt idea generates IntelliJ projects
900
888
jt format run eclipse code formatter
901
- jt graalvm -home prints the GraalVM home of the RUBY_SELECTOR
889
+ jt ruby -home prints the Ruby home of the RUBY_SELECTOR
902
890
903
891
you can also put --build or --rebuild in front of any command to build or rebuild first
904
892
@@ -929,10 +917,6 @@ def launcher
929
917
puts ruby_launcher
930
918
end
931
919
932
- define_method ( :'graalvm-home' ) do
933
- puts graalvm_home
934
- end
935
-
936
920
def build ( *options )
937
921
in_truffleruby_repo_root!
938
922
project = options . shift
@@ -2540,11 +2524,11 @@ def sforceimports
2540
2524
mx_options , mx_build_options = args_split ( options )
2541
2525
mx_args = mx_base_args + mx_options
2542
2526
2527
+ standalone_type = env . include? ( 'native' ) ? 'native' : 'jvm'
2543
2528
mx ( *mx_args , 'build' , *mx_build_options , primary_suite : TRUFFLERUBY_DIR )
2544
- build_dir = mx ( *mx_args , 'graalvm -home' , primary_suite : TRUFFLERUBY_DIR , capture : :out ) . lines . last . chomp
2529
+ build_dir = mx ( *mx_args , 'standalone -home' , "--type= #{ standalone_type } " , 'ruby ', primary_suite : TRUFFLERUBY_DIR , capture : :out ) . lines . last . chomp
2545
2530
2546
2531
dest = "#{ TRUFFLERUBY_DIR } /mxbuild/#{ name } "
2547
- dest_ruby = "#{ dest } /languages/ruby"
2548
2532
FileUtils . rm_rf dest
2549
2533
if @ruby_name != @mx_env
2550
2534
# if `--name NAME` is passed, we want to copy so we don't end up with two symlinks
@@ -2573,7 +2557,7 @@ def sforceimports
2573
2557
2574
2558
link_path = "#{ rubies_dir } /#{ name } "
2575
2559
File . delete link_path if File . symlink? link_path or File . exist? link_path
2576
- File . symlink dest_ruby , link_path
2560
+ File . symlink dest , link_path
2577
2561
end
2578
2562
end
2579
2563
@@ -3171,10 +3155,6 @@ def docker(*args)
3171
3155
require_relative 'docker'
3172
3156
JT ::Docker . new . docker ( *args )
3173
3157
end
3174
-
3175
- def visualvm
3176
- sh "#{ graalvm_home } /bin/jvisualvm"
3177
- end
3178
3158
end
3179
3159
3180
3160
class JT
0 commit comments