-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Etienne Millon <me@emillon.org>
- Loading branch information
Showing
5 changed files
with
112 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
open! Import | ||
|
||
type t = | ||
{ rule_deps : Deps.t | ||
; action_deps : Deps.t | ||
} | ||
|
||
let action_deps t = t.action_deps | ||
|
||
let rule_deps t = t.rule_deps | ||
|
||
let empty = | ||
{ rule_deps = Deps.empty | ||
; action_deps = Deps.empty | ||
} | ||
|
||
let add_rule_paths t fns = | ||
{ t with | ||
rule_deps = Deps.add_paths t.rule_deps fns | ||
} | ||
|
||
let add_rule_path t fn = | ||
{ t with | ||
rule_deps = Deps.add_path t.rule_deps fn | ||
} | ||
|
||
let add_action_paths t fns = | ||
{ t with | ||
action_deps = Deps.add_paths t.action_deps fns | ||
} | ||
|
||
let add_action_env_var t var = | ||
{ t with | ||
action_deps = Deps.add_env_var t.action_deps var | ||
} | ||
|
||
let paths {action_deps; rule_deps} = | ||
Deps.path_union action_deps rule_deps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
open! Import | ||
|
||
(** A simple wrapper around [Deps.t], where some dependencies are recorded as | ||
"rule deps" and other as "action deps". *) | ||
type t | ||
|
||
(** {1} Constructors *) | ||
|
||
(** No dependencies. *) | ||
val empty : t | ||
|
||
(** Add a path as a rule dep. *) | ||
val add_rule_path : t -> Path.t -> t | ||
|
||
(** Add a set of paths as rule deps. *) | ||
val add_rule_paths : t -> Path.Set.t -> t | ||
|
||
(** Add a set of paths as action deps. *) | ||
val add_action_paths : t -> Path.Set.t -> t | ||
|
||
(** Add an environment variable as an action dep. *) | ||
val add_action_env_var : t -> string -> t | ||
|
||
(** {1} Deconstructors *) | ||
|
||
(** Return the rule deps. *) | ||
val rule_deps : t -> Deps.t | ||
|
||
(** Return the action deps. *) | ||
val action_deps : t -> Deps.t | ||
|
||
(** Return the paths deps, both for the rule deps and the action deps . *) | ||
val paths : t -> Path.Set.t |