|
|
@ -29,17 +29,24 @@ type mode =
|
|
|
|
|
|
|
|
|
|
|
|
let equal_mode = [%compare.equal : mode]
|
|
|
|
let equal_mode = [%compare.equal : mode]
|
|
|
|
|
|
|
|
|
|
|
|
let pp_mode fmt mode =
|
|
|
|
let pp_mode fmt = function
|
|
|
|
match mode with
|
|
|
|
| Analyze ->
|
|
|
|
| Analyze
|
|
|
|
F.fprintf fmt "Analyze driver mode"
|
|
|
|
| BuckGenrule _
|
|
|
|
| BuckGenrule prog ->
|
|
|
|
| BuckCompilationDB _
|
|
|
|
F.fprintf fmt "BuckGenRule driver mode:@\nprog = '%s'" prog
|
|
|
|
| ClangCompilationDB _
|
|
|
|
| BuckCompilationDB (prog, args) ->
|
|
|
|
| Python _
|
|
|
|
F.fprintf fmt "BuckCompilationDB driver mode:@\nprog = '%s'@\nargs = %a" prog Pp.cli_args
|
|
|
|
| PythonCapture (_, _)
|
|
|
|
args
|
|
|
|
| XcodeXcpretty _ ->
|
|
|
|
| ClangCompilationDB _ ->
|
|
|
|
(* these are pretty boring, do not log anything *)
|
|
|
|
F.fprintf fmt "ClangCompilationDB driver mode"
|
|
|
|
()
|
|
|
|
| Python args ->
|
|
|
|
|
|
|
|
F.fprintf fmt "Python driver mode:@\nargs = %a" Pp.cli_args args
|
|
|
|
|
|
|
|
| PythonCapture (bs, args) ->
|
|
|
|
|
|
|
|
F.fprintf fmt "PythonCapture driver mode:@\nbuild system = '%s'@\nargs = %a"
|
|
|
|
|
|
|
|
(Config.string_of_build_system bs)
|
|
|
|
|
|
|
|
Pp.cli_args args
|
|
|
|
|
|
|
|
| XcodeXcpretty (prog, args) ->
|
|
|
|
|
|
|
|
F.fprintf fmt "XcodeXcpretty driver mode:@\nprog = '%s'@\nargs = %a" prog Pp.cli_args args
|
|
|
|
| Javac (_, prog, args) ->
|
|
|
|
| Javac (_, prog, args) ->
|
|
|
|
F.fprintf fmt "Javac driver mode:@\nprog = '%s'@\nargs = %a" prog Pp.cli_args args
|
|
|
|
F.fprintf fmt "Javac driver mode:@\nprog = '%s'@\nargs = %a" prog Pp.cli_args args
|
|
|
|
| Maven (prog, args) ->
|
|
|
|
| Maven (prog, args) ->
|
|
|
@ -184,8 +191,7 @@ let capture_with_compilation_database db_files =
|
|
|
|
CaptureCompilationDatabase.capture_files_in_database compilation_database
|
|
|
|
CaptureCompilationDatabase.capture_files_in_database compilation_database
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let capture ~changed_files mode =
|
|
|
|
let capture ~changed_files = function
|
|
|
|
match mode with
|
|
|
|
|
|
|
|
| Analyze ->
|
|
|
|
| Analyze ->
|
|
|
|
()
|
|
|
|
()
|
|
|
|
| BuckCompilationDB (prog, args) ->
|
|
|
|
| BuckCompilationDB (prog, args) ->
|
|
|
@ -271,7 +277,11 @@ let capture ~changed_files mode =
|
|
|
|
~extra_flavors:[] buck_args
|
|
|
|
~extra_flavors:[] buck_args
|
|
|
|
in
|
|
|
|
in
|
|
|
|
let all_args = List.rev_append rev_not_targets targets in
|
|
|
|
let all_args = List.rev_append rev_not_targets targets in
|
|
|
|
let updated_buck_cmd = prog :: command :: Buck.store_args_in_file all_args in
|
|
|
|
let updated_buck_cmd =
|
|
|
|
|
|
|
|
[prog; command]
|
|
|
|
|
|
|
|
@ List.rev_append Config.buck_build_args_no_inline
|
|
|
|
|
|
|
|
(Buck.store_args_in_file all_args)
|
|
|
|
|
|
|
|
in
|
|
|
|
Logging.(debug Capture Quiet)
|
|
|
|
Logging.(debug Capture Quiet)
|
|
|
|
"Processed buck command '%a'@\n" (Pp.seq F.pp_print_string) updated_buck_cmd ;
|
|
|
|
"Processed buck command '%a'@\n" (Pp.seq F.pp_print_string) updated_buck_cmd ;
|
|
|
|
updated_buck_cmd )
|
|
|
|
updated_buck_cmd )
|
|
|
|