diff --git a/manifest/manifest.ml b/manifest/manifest.ml index 3ae4a4722ce86fa61945e54307fd70037db12d9f..b1e64c8102f6b0743bd4bbbf48d333b127328fab 100644 --- a/manifest/manifest.ml +++ b/manifest/manifest.ml @@ -355,6 +355,8 @@ module Dune = struct let setenv name value followup = [G [S "setenv"; S name; S value]; followup] + let progn l = [S "progn"; G (of_list l)] + let chdir_workspace_root followup = [G [S "chdir"; S "%{workspace_root}"]; followup] diff --git a/manifest/manifest.mli b/manifest/manifest.mli index 24049f88794b79e6acd041eb1f38d709a3f4d5e9..d1eb7a42372ef778e1c3e4e66ec601f65abe82fe 100644 --- a/manifest/manifest.mli +++ b/manifest/manifest.mli @@ -175,6 +175,16 @@ module Dune : sig This causes the executed command to be run with [HOME=/tmp] in its environment. *) val setenv : string -> string -> s_expr -> s_expr + (** Make a [progn] user action construction, which allows executing more than + one command. + + Example: + [~action:(progn [run_exe "main"; [S "diff?"; S "expected"; S "output"];])] + results in + [(action (progn (run %{exe:main.exe}) (diff? expected output)))] + *) + val progn : s_expr list -> s_expr + (** Make a [(chdir %{workspace_root} ...)] stanza. Such stanzas are typically used to wrap [run] stanzas (e.g. built with {!run_exe})