@@ -1034,21 +1034,26 @@ def python_build_watch(args):
1034
1034
args = parser .parse_args (args )
1035
1035
if sum ([args .full , args .graalvm , args .no_java ]) > 1 :
1036
1036
mx .abort ("Only one of --full, --graalvm, --no-java can be specified" )
1037
+ if args .full :
1038
+ suffixes = [".c" , ".h" , ".class" , ".jar" , ".java" ]
1039
+ excludes = [".*\\ .py$" ]
1040
+ elif args .graalvm :
1041
+ suffixes = [".c" , ".h" , ".class" , ".jar" , ".java" , ".py" ]
1042
+ excludes = ["mx_.*\\ .py$" ]
1043
+ else :
1044
+ suffixes = [".c" , ".h" , ".class" , ".jar" ]
1045
+ excludes = [".*\\ .py$" , ".*\\ .java$" ]
1046
+
1047
+ cmd = ["inotifywait" , "-q" , "-e" , "close_write,moved_to" , "-r" , "--format=%f" ]
1048
+ for e in excludes :
1049
+ cmd += ["--exclude" , e ]
1050
+ cmd += ["@%s" % os .path .join (SUITE .dir , ".git" ), SUITE .dir ]
1051
+
1037
1052
while True :
1038
1053
out = mx .OutputCapture ()
1039
- mx .run ([
1040
- "inotifywait" , "-q" , "-e" , "close_write,moved_to" , "-r" , "--format=%f" ,
1041
- "--exclude" , ".*\\ .py$" ,
1042
- "@%s" % os .path .join (SUITE .dir , ".git" ),
1043
- SUITE .dir
1044
- ], out = out )
1054
+ mx .run (cmd , out = out )
1045
1055
changed_file = out .data .strip ()
1046
1056
mx .logv (changed_file )
1047
- suffixes = [".c" , ".h" , ".class" , ".jar" ]
1048
- if args .full :
1049
- suffixes .append (".java" )
1050
- elif args .graalvm :
1051
- suffixes .extend ([".java" , ".py" ])
1052
1057
if any (changed_file .endswith (ext ) for ext in [".c" , ".h" , ".class" , ".jar" ]):
1053
1058
mx .log ("Build needed ..." )
1054
1059
time .sleep (2 )
@@ -1058,6 +1063,7 @@ def python_build_watch(args):
1058
1063
mx .log (python_gvm ())
1059
1064
else :
1060
1065
nativebuild ([])
1066
+ mx .log ("Build done." )
1061
1067
1062
1068
1063
1069
# ----------------------------------------------------------------------------------------------------------------------
0 commit comments