File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed 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
+ require 'listen'
15
+ require 'fileutils'
16
+
17
+ FROM = File . expand_path ( '../..' , File . realpath ( __FILE__ ) )
18
+ TO = "#{ FROM } /mxbuild/graalvm/jre/languages/ruby"
19
+
20
+ # Must be consistent with TRUFFLERUBY_GRAALVM_SUPPORT in suite.py
21
+ DIRS_TO_SYNC = %w[
22
+ lib/json
23
+ lib/mri
24
+ lib/patches
25
+ lib/truffle
26
+ ] . map { |path | "#{ FROM } /#{ path } " }
27
+
28
+ listener = Listen . to ( *DIRS_TO_SYNC ) do |modified , added , removed |
29
+ ( modified + added ) . each do |file |
30
+ target = "#{ TO } #{ file [ FROM . size ..-1 ] } "
31
+ FileUtils ::Verbose . cp file , target
32
+ end
33
+ removed . each do |file |
34
+ target = "#{ TO } #{ file [ FROM . size ..-1 ] } "
35
+ FileUtils ::Verbose . rm target
36
+ end
37
+ end
38
+
39
+ listener . start # not blocking
40
+ sleep
You can’t perform that action at this time.
0 commit comments