module Acmd:sig..end
An action command represents the invocation of a program and the possible redirection of its standard file descriptors. Lists of action commands are the building block of actions.
Program executables are represented by the Assemblage.Acmd.cmd
type. Values of this type can be created either with a
configuration key or directly with a static string. If
you are defining build actions you should use a configuration key
and Assemblage.Acmd.cmd as it ensures the program can be redefined at
configuration time thus making the build system more portable for
end users.
The module also provides a few system utility
invocations that enforce portable
behaviour.
type cmd
val cmd : string Assemblage.Conf.key -> cmd Assemblage.Conf.valuecmd name is a program whose name is the value of name.val static : string -> cmdstatic name is a program whose name is name.
Important. For build commands, Assemblage.Acmd.cmd should be used.
Assemblage.Acmd.static is best used for defining test runs and other
convenience development runs.
type t
val v : ?stdin:Assemblage.Path.t ->
?stdout:Assemblage.Path.t ->
?stderr:Assemblage.Path.t ->
cmd -> string list -> tv cmd args represents the execution of program cmd with
argument args and standard file descriptors redirected to
stdin, stdout, and stderr (if specified).module Args:sig..end
Rather than using system utility configuration keys directly you should use the following functions, they will enforce portable behaviour.
Note. Function arguments could support more labelling but
this doesn't blend well with Assemblage.Conf.app.
val dev_null : Assemblage.Path.t Assemblage.Conf.valuedev_null is a file that discards all writes.val cd : (Assemblage.Path.t -> t) Assemblage.Conf.valuecd has a command exec dir to change directory to dir.val ln : (Assemblage.Path.t -> Assemblage.Path.t -> t)
Assemblage.Conf.valueln has a command exec src dst to link symbolically file src to
dst.
Warning. On Windows this is a copy.
val ln_rel : (Assemblage.Path.t -> Assemblage.Path.t -> t)
Assemblage.Conf.valueln_rel has a command exec src dst to link symbolically file
src to dst. FIXME if src and dst are relative this links
src to dst as seen from the empty relative directory (is
that understandable ? is that really needed ?val cp : (Assemblage.Path.t -> Assemblage.Path.t -> t)
Assemblage.Conf.valuecp has a command exec src dst to copy file src to dst.val mv : (Assemblage.Path.t -> Assemblage.Path.t -> t)
Assemblage.Conf.valuemv has a command exec src dst to move path src to dst.val rm_files : (?f:bool -> Assemblage.Path.t list -> t)
Assemblage.Conf.valuerm_files has a command exec ~f paths to remove the file
paths paths. If f is true files are removed regardless of
permissions (defaults to false). paths elements must be files,
for directories, see Assemblage.Acmd.rm_dirs.val rm_dirs : (?f:bool -> ?r:bool -> Assemblage.Path.t list -> t)
Assemblage.Conf.valuerm_dirs has a command exec ~f ~r paths to remove the directory paths paths. If f is true directories are
removed regardless of permissions (defaults to false). If r
is true removes the file hierarchies rooted at the elements of
paths. Note that paths must be directories, for removing
files, see Assemblage.Acmd.rm_files.val mkdir : (Assemblage.Path.t -> t) Assemblage.Conf.valuemkdir has a command exec d to create the directory p.
Intermediate directories are created as required (mkdir -p in
Unix parlance).val stamp : (Assemblage.Path.t -> string -> t) Assemblage.Conf.valuestamp has a command execs f content that writes content to f.