|
|
@ -25,7 +25,7 @@ module Target = struct
|
|
|
|
L.(die ExternalError) "cannot parse target %s" target
|
|
|
|
L.(die ExternalError) "cannot parse target %s" target
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let to_string {name; flavors} = F.asprintf "%s#%a" name (Pp.comma_seq Pp.string) flavors
|
|
|
|
let to_string {name; flavors} = F.asprintf "%s#%a" name (Pp.comma_seq F.pp_print_string) flavors
|
|
|
|
|
|
|
|
|
|
|
|
let add_flavor_internal target flavor =
|
|
|
|
let add_flavor_internal target flavor =
|
|
|
|
if List.mem ~equal:String.equal target.flavors flavor then
|
|
|
|
if List.mem ~equal:String.equal target.flavors flavor then
|
|
|
@ -104,7 +104,7 @@ module Query = struct
|
|
|
|
|
|
|
|
|
|
|
|
let rec pp fmt = function
|
|
|
|
let rec pp fmt = function
|
|
|
|
| Target s ->
|
|
|
|
| Target s ->
|
|
|
|
Pp.string fmt s
|
|
|
|
F.pp_print_string fmt s
|
|
|
|
| Kind {pattern; expr} ->
|
|
|
|
| Kind {pattern; expr} ->
|
|
|
|
F.fprintf fmt "kind(%s, %a)" pattern pp expr
|
|
|
|
F.fprintf fmt "kind(%s, %a)" pattern pp expr
|
|
|
|
| Deps {depth= None; expr} ->
|
|
|
|
| Deps {depth= None; expr} ->
|
|
|
@ -112,7 +112,7 @@ module Query = struct
|
|
|
|
| Deps {depth= Some depth; expr} ->
|
|
|
|
| Deps {depth= Some depth; expr} ->
|
|
|
|
F.fprintf fmt "deps(%a, %d)" pp expr depth
|
|
|
|
F.fprintf fmt "deps(%a, %d)" pp expr depth
|
|
|
|
| Set sl ->
|
|
|
|
| Set sl ->
|
|
|
|
F.fprintf fmt "set(%a)" (Pp.seq Pp.string) sl
|
|
|
|
F.fprintf fmt "set(%a)" (Pp.seq F.pp_print_string) sl
|
|
|
|
| Union exprs ->
|
|
|
|
| Union exprs ->
|
|
|
|
Pp.seq ~sep:" + " pp fmt exprs
|
|
|
|
Pp.seq ~sep:" + " pp fmt exprs
|
|
|
|
|
|
|
|
|
|
|
@ -154,7 +154,7 @@ let resolve_alias_targets aliases =
|
|
|
|
let tmp_prefix = "buck_targets_" in
|
|
|
|
let tmp_prefix = "buck_targets_" in
|
|
|
|
let on_result_lines =
|
|
|
|
let on_result_lines =
|
|
|
|
die_if_empty (fun die ->
|
|
|
|
die_if_empty (fun die ->
|
|
|
|
die "*** No alias found for: '%a'." (Pp.seq ~sep:"', '" Pp.string) aliases )
|
|
|
|
die "*** No alias found for: '%a'." (Pp.seq ~sep:"', '" F.pp_print_string) aliases )
|
|
|
|
in
|
|
|
|
in
|
|
|
|
Utils.with_process_lines ~debug ~cmd ~tmp_prefix ~f:on_result_lines
|
|
|
|
Utils.with_process_lines ~debug ~cmd ~tmp_prefix ~f:on_result_lines
|
|
|
|
|
|
|
|
|
|
|
@ -175,8 +175,9 @@ let split_buck_command buck_cmd =
|
|
|
|
(command, args)
|
|
|
|
(command, args)
|
|
|
|
| _ ->
|
|
|
|
| _ ->
|
|
|
|
L.(die UserError)
|
|
|
|
L.(die UserError)
|
|
|
|
"ERROR: cannot parse buck command `%a`. Expected %a." (Pp.seq Pp.string) buck_cmd
|
|
|
|
"ERROR: cannot parse buck command `%a`. Expected %a." (Pp.seq F.pp_print_string) buck_cmd
|
|
|
|
(Pp.seq ~sep:" or " Pp.string) accepted_buck_commands
|
|
|
|
(Pp.seq ~sep:" or " F.pp_print_string)
|
|
|
|
|
|
|
|
accepted_buck_commands
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(** Given a list of arguments return the extended list of arguments where
|
|
|
|
(** Given a list of arguments return the extended list of arguments where
|
|
|
@ -238,7 +239,8 @@ let add_flavors_to_buck_arguments ~filter_kind ~dep_depth ~extra_flavors origina
|
|
|
|
match targets with
|
|
|
|
match targets with
|
|
|
|
| [] ->
|
|
|
|
| [] ->
|
|
|
|
L.(die UserError)
|
|
|
|
L.(die UserError)
|
|
|
|
"ERROR: no targets found in Buck command `%a`." (Pp.seq Pp.string) original_buck_args
|
|
|
|
"ERROR: no targets found in Buck command `%a`." (Pp.seq F.pp_print_string)
|
|
|
|
|
|
|
|
original_buck_args
|
|
|
|
| _ ->
|
|
|
|
| _ ->
|
|
|
|
let rev_not_targets = parsed_args.rev_not_targets' in
|
|
|
|
let rev_not_targets = parsed_args.rev_not_targets' in
|
|
|
|
let targets =
|
|
|
|
let targets =
|
|
|
|