File tree Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Expand file tree Collapse file tree 2 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -593,6 +593,7 @@ def help
593
593
jt install jvmci install a JVMCI JDK in the parent directory
594
594
jt install graal [--no-jvmci] install Graal in the parent directory (--no-jvmci to use the system Java)
595
595
jt docker build a Docker image - see doc/contributor/docker.md
596
+ jt sync continuously synchronize changes from the Ruby source files to the GraalVM build
596
597
597
598
you can also put --build or --rebuild in front of any command to build or rebuild first
598
599
@@ -2097,6 +2098,10 @@ def verify_native_bin!
2097
2098
end
2098
2099
private :verify_native_bin!
2099
2100
2101
+ def sync
2102
+ exec ( RbConfig . ruby , "#{ TRUFFLERUBY_DIR } /tool/sync.rb" )
2103
+ end
2104
+
2100
2105
def docker ( *args )
2101
2106
command = args . shift
2102
2107
case command
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env ruby
2
+
3
+ # Copyright (c) 2019 Oracle and/or its affiliates. All rights reserved.
4
+ # This code is released under a tri EPL/GPL/LGPL license. You can use it,
5
+ # redistribute it and/or modify it under the terms of the:
6
+ #
7
+ # Eclipse Public License version 1.0, or
8
+ # GNU General Public License version 2, or
9
+ # GNU Lesser General Public License version 2.1.
10
+
11
+ # A script to synchronize changes from the Ruby source files
12
+ # to the GraalVM build instantaneously.
13
+
14
+ # Use 'gem install listen' to install this dependency
15
+ require 'listen'
16
+
17
+ require 'fileutils'
18
+
19
+ FROM = File . expand_path ( '../..' , File . realpath ( __FILE__ ) )
20
+ TO = "#{ FROM } /mxbuild/graalvm/jre/languages/ruby"
21
+
22
+ # Must be consistent with TRUFFLERUBY_GRAALVM_SUPPORT in suite.py
23
+ DIRS_TO_SYNC = %w[
24
+ lib/json
25
+ lib/mri
26
+ lib/patches
27
+ lib/truffle
28
+ ] . map { |path | "#{ FROM } /#{ path } " }
29
+
30
+ listener = Listen . to ( *DIRS_TO_SYNC ) do |modified , added , removed |
31
+ ( modified + added ) . each do |file |
32
+ target = "#{ TO } #{ file [ FROM . size ..-1 ] } "
33
+ FileUtils ::Verbose . cp file , target
34
+ end
35
+ removed . each do |file |
36
+ target = "#{ TO } #{ file [ FROM . size ..-1 ] } "
37
+ FileUtils ::Verbose . rm target
38
+ end
39
+ end
40
+
41
+ listener . start # not blocking
42
+ sleep
You can’t perform that action at this time.
0 commit comments