OASISPluginPlugins creation and management
The whole module is not exported.
module MapPlugin :
OASISUtils.MapExt.S with type key = OASISTypes.plugin_kind OASISTypes.pluginmodule SetPlugin :
OASISUtils.SetExt.S with type elt = OASISTypes.plugin_kind OASISTypes.pluginval mem_no_version :
OASISTypes.plugin_kind OASISTypes.plugin ->
SetPlugin.t ->
booltype 'a setter = OASISTypes.plugin_data ref -> 'a -> unittype 'a getter = OASISTypes.plugin_data ref -> 'atype ('a, 'b) setup_changes = {chng_moduls : modul list;OCaml module to be added to setup file
*)chng_main : 'a OASISDataNotation.func;Main function to be added to BaseSetup.t (i.e. the one that that really do something: configure, build, test...)
*)chng_clean : 'b OASISDataNotation.func option;Function to be called when cleaning
*)chng_distclean : 'b OASISDataNotation.func option;Function to be called when distcleaning
*)}Describe setup file changes.
type context_act = {ctxt : OASISContext.t;Global context.
*)update : OASISSetupUpdate.t;What is the value given to -setup-update ?
*)error : bool;Are there errors?
*)files : OASISFileTemplate.templates;Generated files.
*)other_actions : (unit -> unit) list;Extra actions.
*)}Describe context when applying a plugin.
type ('a, 'b) section_act =
context_act ->
OASISTypes.package ->
(OASISTypes.common_section * 'a) ->
context_act
* (ctxt:OASISContext.t ->
OASISTypes.package ->
(OASISTypes.common_section * 'a) ->
string array ->
'b,
ctxt:OASISContext.t ->
OASISTypes.package ->
(OASISTypes.common_section * 'a) ->
string array ->
unit)
setup_changesGenerator for sections (document, test).
type package_act =
context_act ->
OASISTypes.package ->
context_act
* (ctxt:OASISContext.t ->
OASISTypes.package ->
string array ->
unit,
ctxt:OASISContext.t ->
OASISTypes.package ->
string array ->
unit)
setup_changesGenerator with a package argument only (build, install).
type all_t = OASISTypes.plugin_kind tBase types for all plugins
val register_quickstart_completion :
all_t ->
(OASISTypes.package -> OASISTypes.package) ->
unitRegister a quickstart completion for this plugin
val quickstart_completion :
OASISTypes.plugin_kind OASISTypes.plugin ->
OASISTypes.package ->
OASISTypes.packageGet quickstart completion
val register_generator_package :
all_t ->
'a prop ->
(PropList.Data.t -> 'a) ->
unitRegister a generator for package, to store data of a plugin
val generator_package :
OASISTypes.plugin_kind OASISTypes.plugin ->
OASISTypes.plugin_data ref ->
PropList.Data.t ->
unitCall generator for provided plugin
val register_generator_section :
OASISTypes.section_kind ->
all_t ->
'a prop ->
(PropList.Data.t -> 'a) ->
unitRegister a generator for a section, to store data of a plugin
val generator_section :
OASISTypes.section_kind ->
OASISTypes.plugin_kind OASISTypes.plugin ->
OASISTypes.plugin_data ref ->
PropList.Data.t ->
unitCall generator for provided plugin on a section
val ls : OASISTypes.plugin_kind -> OASISTypes.name listList registered plugins of given kind.
val all_plugins : unit -> OASISTypes.plugin_kind OASISTypes.plugin listAll registered plugin.
val help_default : string list -> helpval register_help :
[ `All | OASISTypes.plugin_kind ] OASISTypes.plugin ->
help ->
unitRegister general help. We only rely on plugin name and version. The replacement field will be computed using the kind of the plugin.
val help : [ `All ] OASISTypes.plugin -> helpGet general help text
val to_plugin : 'a t -> 'a OASISTypes.pluginConvert back to plugin
module type PLUGINS = sig ... endModule to manage a set of plugins, of the same type.
module Configure :
PLUGINS
with type act = package_act
and type data = OASISTypes.package
and type kind = [ `Configure ]This module manage plugin that can handle configure step.
module Build :
PLUGINS
with type act = package_act
and type data = OASISTypes.package
and type kind = [ `Build ]This module manage plugin that can handle build step.
module Doc :
PLUGINS
with type act = (OASISTypes.doc, unit) section_act
and type data = OASISTypes.common_section * OASISTypes.doc
and type kind = [ `Doc ]This module manage plugin that can handle building documents.
module Test :
PLUGINS
with type act = (OASISTypes.test, float) section_act
and type data = OASISTypes.common_section * OASISTypes.test
and type kind = [ `Test ]This module manage plugin that can handle running tests.
module Install :
PLUGINS
with type act = package_act * package_act
and type data = OASISTypes.package
and type kind = [ `Install ]This module manage plugin that can handle install/uninstall steps.
module Extra :
PLUGINS
with type act = context_act -> OASISTypes.package -> context_act
and type data = OASISTypes.package
and type kind = [ `Extra ]This module manage plugin that can handle configure step.
Check that a field name has the form to match a plugin. Don't check that the plugin exists. This functions help to ignore plugin fields.
val builtin : 'a -> OASISTypes.name -> 'a OASISTypes.pluginUse a builtin plugin (i.e. version = OASIS version).
val add_file : OASISFileTemplate.template -> context_act -> context_actAdd a template to context
val set_error : bool -> string -> context_act -> context_actDefine an error in context. It doesn't stop processing, it just sets the context_act.error value.
val plugin_of_string : 'a -> string -> 'a OASISTypes.pluginGet a plugin from a string
val plugins_of_string : 'a -> string -> 'a OASISTypes.plugin listGet a list of plugins from a string
val string_of_plugin : 'a OASISTypes.plugin -> stringGet a list of plugins from a string
val plugin_compare : 'a OASISTypes.plugin -> 'a OASISTypes.plugin -> intCompare plugin, caseless for name and don't take into account version if one is not set.
val plugin_equal : 'a OASISTypes.plugin -> 'a OASISTypes.plugin -> boolTest equality for plugins, a special case of plugin_compare.
val data_create : unit -> OASISTypes.plugin_data refCreate storage for plugin data.
val data_new_property :
?purpose:OASISTypes.plugin_data_purpose ->
OASISTypes.plugin_kind OASISTypes.plugin ->
'a propdata_new_property plg Create a property that can store plugin data. Beware that the the couple (plg, purpose) must be unique.