From 987d437a99101d57c0bbae250af6b1a05f4a4128 Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Fri, 3 Mar 2017 08:57:20 +0000 Subject: [PATCH] Revert name change --- src/{user_action.ml => action.ml} | 0 src/build.ml | 6 +++--- src/build.mli | 4 ++-- src/gen_rules.ml | 16 ++++++++-------- src/jbuild_types.ml | 8 ++++---- 5 files changed, 17 insertions(+), 17 deletions(-) rename src/{user_action.ml => action.ml} (100%) diff --git a/src/user_action.ml b/src/action.ml similarity index 100% rename from src/user_action.ml rename to src/action.ml diff --git a/src/build.ml b/src/build.ml index c1e49f5d..d3d5d321 100644 --- a/src/build.ml +++ b/src/build.ml @@ -166,7 +166,7 @@ let run ?(dir=Path.root) ?stdout_to ?env ?(extra_targets=[]) prog args = module Shexp = struct open Future - open User_action.Mini_shexp + open Action.Mini_shexp let run ~dir ~env ~env_extra ~stdout_to ~tail prog args = let stdout_to : Future.stdout_to = @@ -247,9 +247,9 @@ module Shexp = struct exec t ~dir ~env ~env_extra:String_map.empty ~stdout_to:None ~tail:true end -let user_action action ~dir ~env ~targets = +let action action ~dir ~env ~targets = prim ~targets (fun () -> - match (action : _ User_action.t) with + match (action : _ Action.t) with | Bash cmd -> Future.run Strict ~dir:(Path.to_string dir) ~env "/bin/bash" ["-e"; "-u"; "-o"; "pipefail"; "-c"; cmd] diff --git a/src/build.mli b/src/build.mli index c309eaed..223d9ea5 100644 --- a/src/build.mli +++ b/src/build.mli @@ -64,8 +64,8 @@ val run -> 'a Arg_spec.t list -> ('a, unit) t -val user_action - : string User_action.t +val action + : string Action.t -> dir:Path.t -> env:string array -> targets:Path.t list diff --git a/src/gen_rules.ml b/src/gen_rules.ml index 0dc4a165..5c8f1bbe 100644 --- a/src/gen_rules.ml +++ b/src/gen_rules.ml @@ -1293,16 +1293,16 @@ module Gen(P : Params) = struct | User actions | +-----------------------------------------------------------------+ *) - module User_action_interpret : sig + module Action_interpret : sig val run - : User_action.Unexpanded.t + : Action.Unexpanded.t -> dir:Path.t -> dep_kind:Build.lib_dep_kind -> targets:Path.t list -> deps:Dep_conf.t list -> (unit, unit) Build.t end = struct - module U = User_action.Unexpanded + module U = Action.Unexpanded type resolved_forms = { (* Mapping from ${...} forms to their resolutions *) @@ -1380,7 +1380,7 @@ module Gen(P : Params) = struct in let forms = extract_artifacts ~dir t in let t = - User_action.Unexpanded.expand dir t + Action.Unexpanded.expand dir t ~f:(expand_string_with_vars ~artifacts:forms.artifacts ~targets ~deps) in let build = @@ -1390,7 +1390,7 @@ module Gen(P : Params) = struct >>> Build.paths (String_map.values forms.artifacts) >>> - Build.user_action t ~dir ~env:ctx.env ~targets + Build.action t ~dir ~env:ctx.env ~targets in match forms.failures with | [] -> build @@ -1406,7 +1406,7 @@ module Gen(P : Params) = struct add_rule (Dep_conf_interpret.dep_of_list ~dir rule.deps >>> - User_action_interpret.run + Action_interpret.run rule.action ~dir ~dep_kind:Required @@ -1420,7 +1420,7 @@ module Gen(P : Params) = struct let action = match alias_conf.action with | None -> Sexp.Atom "none" - | Some a -> List [Atom "some" ; User_action.Unexpanded.sexp_of_t a] in + | Some a -> List [Atom "some" ; Action.Unexpanded.sexp_of_t a] in Sexp.List [deps ; action] |> Sexp.to_string |> Digest.string @@ -1435,7 +1435,7 @@ module Gen(P : Params) = struct | None -> deps | Some action -> deps - >>> User_action_interpret.run + >>> Action_interpret.run action ~dir ~dep_kind:Required diff --git a/src/jbuild_types.ml b/src/jbuild_types.ml index f8a3e68f..78d844bf 100644 --- a/src/jbuild_types.ml +++ b/src/jbuild_types.ml @@ -546,13 +546,13 @@ module Rule = struct type t = { targets : string list (** List of files in the current directory *) ; deps : Dep_conf.t list - ; action : User_action.Unexpanded.t + ; action : Action.Unexpanded.t } let common = field "targets" (list file_in_current_dir) >>= fun targets -> field "deps" (list Dep_conf.t) ~default:[] >>= fun deps -> - field "action" User_action.Unexpanded.t >>= fun action -> + field "action" Action.Unexpanded.t >>= fun action -> return { targets; deps; action } let v1 = record common @@ -660,13 +660,13 @@ module Alias_conf = struct type t = { name : string ; deps : Dep_conf.t list - ; action : User_action.Unexpanded.t option + ; action : Action.Unexpanded.t option } let common = field "name" string >>= fun name -> field "deps" (list Dep_conf.t) ~default:[] >>= fun deps -> - field_o "action" User_action.Unexpanded.t >>= fun action -> + field_o "action" Action.Unexpanded.t >>= fun action -> return { name ; deps