Complete command-line support for reactive mode with buck on iOS.

Reviewed By: sblackshear

Differential Revision: D3080674

fb-gh-sync-id: 226e740
shipit-source-id: 226e740
master
Cristiano Calcagno 9 years ago committed by Facebook Github Bot 5
parent a71caccc80
commit e34e369835

@ -68,6 +68,9 @@ base_group.add_argument('-ic', '--changed-only',
base_group.add_argument('-r', '--reactive', action='store_true', base_group.add_argument('-r', '--reactive', action='store_true',
help='''Analyze in reactive propagation mode help='''Analyze in reactive propagation mode
starting from changed files.''') starting from changed files.''')
base_group.add_argument('-m', '--merge', action='store_true',
help='''merge the captured results directories specified
in the dependency file.''')
base_group.add_argument('-c', '--continue', action='store_true', base_group.add_argument('-c', '--continue', action='store_true',
dest='continue_capture', dest='continue_capture',
help='''Continue the capture for the reactive help='''Continue the capture for the reactive
@ -320,6 +323,9 @@ class AnalyzerWrapper(object):
if self.args.continue_capture: if self.args.continue_capture:
infer_options.append('-continue') infer_options.append('-continue')
if self.args.merge:
infer_options.append('-merge')
if self.args.specs_dirs: if self.args.specs_dirs:
infer_options += self.args.specs_dirs infer_options += self.args.specs_dirs

@ -164,7 +164,7 @@ let arg_desc =
None, None,
" activate the eradicate checker for java annotations" " activate the eradicate checker for java annotations"
; ;
"-merge_captured", "-merge",
Arg.Unit MergeCapture.merge_captured_targets, Arg.Unit MergeCapture.merge_captured_targets,
None, None,
"merge the captured results directories specified in the dependency file" "merge the captured results directories specified in the dependency file"

@ -14,9 +14,9 @@ module F = Format
(** Flag to control whether the timestamp of symbolic links (** Flag to control whether the timestamp of symbolic links
is used to determine whether a captured directory needs to be merged. *) is used to determine whether a captured directory needs to be merged. *)
let check_timestamp_of_symlinks = false let check_timestamp_of_symlinks = true
let buck_out = ref (Filename.concat (Sys.getcwd ()) "buck-out") let buck_out () = Filename.concat (Filename.dirname !Config.results_dir) "buck-out"
let infer_deps () = Filename.concat !Config.results_dir "infer-deps.txt" let infer_deps () = Filename.concat !Config.results_dir "infer-deps.txt"
@ -80,7 +80,7 @@ let should_link ~target ~target_results_dir ~stats infer_out_src infer_out_dst =
if debug >= 2 then if debug >= 2 then
L.stderr "file:%s time_orig:%f time_link:%f@." L.stderr "file:%s time_orig:%f time_link:%f@."
file time_orig time_link; file time_orig time_link;
time_link >= time_orig in time_link > time_orig in
let symlinks_up_to_date captured_file = let symlinks_up_to_date captured_file =
if Sys.is_directory captured_file then if Sys.is_directory captured_file then
let contents = Array.to_list (Sys.readdir captured_file) in let contents = Array.to_list (Sys.readdir captured_file) in
@ -130,7 +130,7 @@ let process_merge_file deps_file =
let process_line line = let process_line line =
match Str.split_delim (Str.regexp (Str.quote "\t")) line with match Str.split_delim (Str.regexp (Str.quote "\t")) line with
| target :: _ :: target_results_dir :: _ -> | target :: _ :: target_results_dir :: _ ->
let infer_out_src = Filename.concat (Filename.dirname !buck_out) target_results_dir in let infer_out_src = Filename.concat (Filename.dirname (buck_out ())) target_results_dir in
if should_link ~target ~target_results_dir ~stats infer_out_src infer_out_dst if should_link ~target ~target_results_dir ~stats infer_out_src infer_out_dst
then slink ~stats infer_out_src infer_out_dst then slink ~stats infer_out_src infer_out_dst
| _ -> | _ ->
@ -144,5 +144,4 @@ let process_merge_file deps_file =
let merge_captured_targets () = let merge_captured_targets () =
process_merge_file (infer_deps ()); process_merge_file (infer_deps ())
exit 0

Loading…
Cancel
Save