module Conf:sig..end
A configuration represents a concrete build environment for a project. It allows to adjust a project's outcomes to the build environment and desires of the end user.
A configuration is a map from named keys to configuration values. The value associated to a key is either determined automatically from the environment by the key's default value or explicitly set by the end user of the build system (e.g. manually from the command line or via an IDE).
A configuration value denotes an OCaml value that depends on the configuration. Configuration values are transformed and composed into new values and keep track of the set of keys that are needed to define them. Since they must be used to define a project, it means that assemblage can (conservatively) determine the configuration keys of a project.
Configuration schemes are named, user defined, partial configurations. They allow the ends user to quickly setup a given configuration (in general it's a good practice not to use them in the context of package distribution, try to rely on the defaults as much as possible).
Important. Before defining your own keys you should prefer the
built-in ones.
type 'a value
'a.
A value of this type means that it depends on the configuration:
its concrete value can not be determined without a
configuration. We say that we evaluate a value when we take
a configuration and determine its OCaml value in that configuration.
val const : 'a -> 'a valueconst v is a configuration value that evaluates to v.val app : ('a -> 'b) value ->
'a value -> 'b valueapp f v is a configuration value that evaluates to the result
of applying the evaluation of v to the one of f.val ($) : ('a -> 'b) value ->
'a value -> 'b valuef $ v is app f v.val true_ : bool valuetrue_ is const true.val false_ : bool valuefalse_ is const false.val neg : bool value -> bool valueneg a is const ( not ) $ a.val (&&&) : bool value ->
bool value -> bool valuea &&& b is const ( && ) $ a $ b.val (|||) : bool value ->
bool value -> bool valuea &&& b is const ( || ) $ a $ b.val pick_if : bool value ->
'a value ->
'a value -> 'a valuepick_if c a b is a if c evaluates to true and b
otherwise.module Option:sig..end
A configuration converter transforms a string value to an OCaml
value and vice-versa. There are a few built-in
converters.
type'aparser =string -> [ `Error of string | `Ok of 'a ]
type'aprinter =Format.formatter -> 'a -> unit
type'aconverter ='a parser * 'a printer
val parser : 'a converter -> 'a parserparser c is c's parser.val printer : 'a converter -> 'a printerconverter c is c's printer.type 'a key
val key : ?public:bool ->
?docs:string ->
?docv:string ->
?doc:string ->
string ->
'a converter ->
'a value -> 'a keykey public docs docv doc name conv v is a configuration key
named name that maps to value v by default. converter is
used to convert key values provided by end users.
If public is true (default), the key is public which means
that it can be redefined by the end user. In this case docs is
the title of a documentation section under which the key is
documented (defaults to Assemblage.Conf.docs_project). doc is a short
documentation string for the key, this should be a single
sentence or paragraph starting with a capital letter and ending
with a dot. docv is a meta-variable for representing the
values of the key (e.g. "BOOL" for a boolean).
Raises Invalid_argument if the key name is not made of a
sequence of ASCII lowercase letter, digit, dash or underscore.
FIXME not implemented.
Warning. No two public keys should share the same name as
this may lead to difficulties in the UI of certain assemblage
drivers like the inability to be able to precisely refer to a
key. In particular do not reuse the built-in
names (they have the same name as the key variables with
underscores replaced by dashes).
val value : 'a key -> 'a valuevalue k is a value that evaluates to k's binding in the
configuration. Note that this may be different from the value given in
Assemblage.Conf.key.type scheme
type def
val def : 'a key -> 'a -> defdef k v is a definition that binds key k to value v.val defv : 'a key -> 'a value -> defdefv k v is a definition that binds key k to value v.val scheme : ?doc:string ->
?base:scheme ->
string -> def list -> schemescheme base name defs is a configuration scheme named name
that has the key-value bindings of base together with those
of defs, the latter taking precedence. doc is a documentation
string for the scheme, it should be a single sentence or paragraph
starting with a capital letter and ending with a dot.val project_version : string keyproject_version is the version number of the project (defaults
is inferred from the VCS). FIXME what to do on distrib setup ?
read from a file ? Best would be that the distrib procedure
sets the version field of the opam file in the tarball and
that we read from there.val docs_project : stringdocs_project is the name of the documentation section
in which project keys are described.val debug : bool keydebug is true iff build products in general must support debugging
(defaults to false).val profile : bool keyprofile is true iff build products in general must support profiling
(defaults to false).val warn_error : bool keywarn_error is true iff tools in general should treat
warnings as errors (defaults to false).val test : bool keytest is true iff test build products should be built
(defaults to false).val doc : bool keydoc is true iff documentation should be built
(defaults to false).val jobs : int keyjobs is the number of jobs to run for building (defaults to machine
processor count).val docs_build_properties : stringdocs_build_properties is the name of the documentation section
in which build property keys are described.val root_dir : Assemblage.Path.t keyroot_dir is the absolute path to the project directory (defaults
to the driver program current directory).val build_dir : Assemblage.Path.rel keybuild_dir is the path to the build directory expressed relative to the
Assemblage.Conf.root_dir (defaults to "_build").val docs_build_directories : stringdocs_build_directories is the name of the documentation section
in which build directory keys are described.val ocaml_native_tools : bool keyocaml_native_tools is true to use the native compiled (.opt)
OCaml tools (defaults to true).val ocaml_version : (int * int * int * string option) keyocaml_version is the OCaml compiler version (defaults is inferred
by invoking an OCaml compiler).val ocaml_byte : bool keyocaml_byte is true iff OCaml byte code compilation is
requested (defaults to true).val ocaml_native : bool keyocaml_native is true iff OCaml native code compilation is
requested (defaults to true).val ocaml_native_dynlink : bool keyocaml_native_dynlink is true iff OCaml native code dynamic linking
compilation is requested (defaults to true).val ocaml_js : bool keyocaml_js is true iff OCaml JavaScript compilation is requested
(defaults to false).val ocaml_annot : bool keyocaml_annot is true iff OCaml binary annotation files generation
is requested (defaults to true).val ocaml_build_ast : bool keyocaml_build_ast is true if OCaml source AST should be built
and dumped to a file with Assemblage.Conf.ocaml_dumpast (defaults to
false). This may speed up your builds if you have
pre-processing cancer.val ocaml_dumpast : string key
val ocamlc : string keyocamlc is the
ocamlc
utility (defaults to "ocamlc" or "ocamlc.opt" according to
Assemblage.Conf.ocaml_native_tools).val ocamlopt : string keyocamlopt is the
ocamlopt
utility (defaults to "ocamlopt" or "ocamlopt.opt" according to
Assemblage.Conf.ocaml_native_tools).val js_of_ocaml : string key
val ocamldep : string keyocamldep is the
ocamldep
utility (defaults to "ocamldep" or "ocamldep.opt" according to
Assemblage.Conf.ocaml_native_tools).val ocamlmklib : string key
val ocamldep : string keyocamldep is the
ocamldoc
utility (defaults to "ocamldoc" or "ocamldoc.opt" according to
Assemblage.Conf.ocaml_native_tools).val ocamllex : string keyocamllex is the
ocamllex utility (defaults to "ocamllex" or "ocamllex.opt"
according to Assemblage.Conf.ocaml_native_tools).val ocamlyacc : string key
val ocaml : string key
val ocamlrun : string key
val ocamldebug : string key
val ocamlprof : string key
val ocamlfind : string key
val opam : string key
val opam_installer : string keyopam_installer is the opam-installer tool
(defaults to "opam-installer")val opam_admin : string keyopam_admin is the opam-admin tool (defaults to "opam-admin")val docs_ocaml_system : stringdocs_ocaml_system is the name of the documentation section
in which OCaml system keys are described.val c_dynlink : bool keyc_dynlink is true iff C dynamic linking compilation is
requested (default to true).val c_js : bool keyc_js is true iff C JavaScript compilation is request (defaults
to false). FIXME through e.g. emscripten should we support that ?
Well it's just a few actions after all.val cc : string keycc is the C compiler (defaults to "cc")val pkg_config : string key
val docs_c_system : stringdocs_c_system is the name of the documentation section
in which C system keys are described.val uname : string key
val host_os : string keyhost_os is the operating system name of the host machine (defaults
is "Win32" if the driver's Sys.os_type is "Win32"
otherwise it is the lowercased result of Assemblage.Conf.uname invoked with -s).val host_arch : string keyhost_arch is the hardware architecture of the host machine
(defaults to the value of the driver's
"PROCESSOR_ARCHITECTURE" environment variable if the driver
Sys.os_type is "Win32" otherwise it is the lowercased
result of Assemblage.Conf.uname invoked with -m)val host_word_size : int keyhost_word_size is the host machine word bit size (defaults to
the driver's Sys.word_size).val target_os : string keytarget_os is the operating system name of the target machine (defaults
to the value of Assemblage.Conf.host_os).val target_arch : string keytarget_arch is the hardware architecture of the target machine (defaults
to the value of Assemblage.Conf.host_arch).val target_word_size : int keytarget_word_size is the target machine word bit size (defaults to
the value of Assemblage.Conf.host_word_size).val docs_machine_information : stringdocs_machine_utilities is the name of the documentation section
in which machine information keys are described.
Note. Action commands should not use these utilities directly
but use portable system utility
invocations.
val echo : string key
val cd : string key
val ln : string key
val cp : string key
val mv : string key
val rm : string key
val rmdir : string key
val mkdir : string key
val cat : string key
val make : string key
val docs_system_utilities : stringdocs_system_utilities is the name of the documentation section
in which system utility keys are described.val bool : bool converterbool converts values with bool_of_string.val int : int converterint converts values with int_of_string.val string : string converterstring converts values with the indentity function.val path : Assemblage.Path.t converter
val abs_path : Assemblage.Path.abs converter
val rel_path : Assemblage.Path.rel converter
val enum : (string * 'a) list -> 'a converterenum l converts values such that string names in l map to
the corresponding value of type 'a.val version : (int * int * int * string option) converterversion converts values of the form
[v|V]major.minor[.patch][(-|+).*].