From 0462d4a11f049ec601aa3692ca67122ea3cc2c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Dimino?= Date: Tue, 28 Feb 2017 06:03:20 +0000 Subject: [PATCH] Remove dependency Named_artifacts --> Context --- src/gen_rules.ml | 2 +- src/named_artifacts.ml | 8 ++++---- src/named_artifacts.mli | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gen_rules.ml b/src/gen_rules.ml index 7d19de37..0f716d04 100644 --- a/src/gen_rules.ml +++ b/src/gen_rules.ml @@ -243,7 +243,7 @@ module Gen(P : Params) = struct module Named_artifacts = struct open Named_artifacts - let t = create ctx findlib (List.map P.stanzas ~f:(fun d -> (d.ctx_dir, d.stanzas))) + let t = create ~path:ctx.path findlib (List.map P.stanzas ~f:(fun d -> (d.ctx_dir, d.stanzas))) let binary name = Build.arr (fun _ -> binary t name) let in_findlib ~dir ~dep_kind name = diff --git a/src/named_artifacts.ml b/src/named_artifacts.ml index d0a6a103..4156957e 100644 --- a/src/named_artifacts.ml +++ b/src/named_artifacts.ml @@ -2,12 +2,12 @@ open Import open Jbuild_types type t = - { context : Context.t + { path : Path.t list ; findlib : Findlib.t ; artifacts : (string, Path.t) Hashtbl.t } -let create context findlib stanzas = +let create ~path findlib stanzas = let artifacts : (string, Path.t) Hashtbl.t = Hashtbl.create 1024 in List.iter stanzas ~f:(fun (dir, stanzas) -> List.iter stanzas ~f:(fun stanza -> @@ -15,13 +15,13 @@ let create context findlib stanzas = | Provides { name; file } -> Hashtbl.add artifacts ~key:name ~data:(Path.relative dir file) | _ -> ())); - { context; findlib; artifacts } + { path; findlib; artifacts } let binary t name = match Hashtbl.find t.artifacts name with | Some p -> p | None -> - match Context.which t.context name with + match Bin.which ~path:t.path name with | Some p -> Hashtbl.add t.artifacts ~key:name ~data:p; p diff --git a/src/named_artifacts.mli b/src/named_artifacts.mli index af9d0cd0..68b71b56 100644 --- a/src/named_artifacts.mli +++ b/src/named_artifacts.mli @@ -7,7 +7,7 @@ open! Import type t -val create : Context.t -> Findlib.t -> (Path.t * Jbuild_types.Stanza.t list) list -> t +val create : path:Path.t list -> Findlib.t -> (Path.t * Jbuild_types.Stanza.t list) list -> t (** In the three following functions, the string argument matches the first argument of the [(provides ...)] stanza in the jbuild. *)