Add (alias_rec ...) in dependency specification

(alias_rec XXX) means the same as @XXX on the command line.
This commit is contained in:
Jeremie Dimino 2017-09-29 16:52:54 +01:00 committed by Rudi Grinberg
parent b281554009
commit b69a6432dd
3 changed files with 12 additions and 4 deletions

View File

@ -200,6 +200,7 @@ module Dep_conf = struct
type t =
| File of String_with_vars.t
| Alias of String_with_vars.t
| Alias_rec of String_with_vars.t
| Glob_files of String_with_vars.t
| Files_recursively_in of String_with_vars.t
@ -211,6 +212,7 @@ module Dep_conf = struct
sum
[ cstr "file" (fun x -> File x)
; cstr "alias" (fun x -> Alias x)
; cstr "alias_rec" (fun x -> Alias_rec x)
; cstr "glob_files" (fun x -> Glob_files x)
; cstr "files_recursively_in" (fun x -> Files_recursively_in x)
]
@ -226,6 +228,8 @@ module Dep_conf = struct
List [Atom "file" ; String_with_vars.sexp_of_t t]
| Alias t ->
List [Atom "alias" ; String_with_vars.sexp_of_t t]
| Alias_rec t ->
List [Atom "alias_rec" ; String_with_vars.sexp_of_t t]
| Glob_files t ->
List [Atom "glob_files" ; String_with_vars.sexp_of_t t]
| Files_recursively_in t ->

View File

@ -93,6 +93,7 @@ module Dep_conf : sig
type t =
| File of String_with_vars.t
| Alias of String_with_vars.t
| Alias_rec of String_with_vars.t
| Glob_files of String_with_vars.t
| Files_recursively_in of String_with_vars.t

View File

@ -410,11 +410,14 @@ module Deps = struct
| File s ->
let path = Path.relative dir (expand_vars t ~scope ~dir s) in
Build.path path
>>^ fun _ -> [path]
>>^ fun () -> [path]
| Alias s ->
let path = Alias.file (Alias.make ~dir (expand_vars t ~scope ~dir s)) in
Build.path path
>>^ fun _ -> []
Alias.dep (Alias.make ~dir (expand_vars t ~scope ~dir s))
>>^ fun () -> []
| Alias_rec s ->
Alias.dep_rec ~loc:(String_with_vars.loc s) ~file_tree:t.file_tree
(Alias.make ~dir (expand_vars t ~scope ~dir s))
>>^ fun () -> []
| Glob_files s -> begin
let path = Path.relative dir (expand_vars t ~scope ~dir s) in
match Glob_lexer.parse_string (Path.basename path) with