☰

Manifest compiler

Author(s): Jose F. Morales.

This module implements predicates to load, consult, and compile Manifest.pl files. A Manifest file allows the specification of a bundle:

NOTE: Configuration flags and nested definitions must be defined in a <bundle>.hooks.pl module.

The dependencies are given with depends(Deps), where each element is a bundle name or Bundle-Props. The properties are:

  • optional: the bundle is used when it is present.
  • host: this bundle is an extension of Bundle, its host.
  • fragment (in a host): an extension that must be available when the host is compiled, since the compiled code of the host depends on its presence and configuration. It must declare the host as Host-[host]. A host and its present fragments are configured together and built together, whatever the order in which they are given to the build commands (see bundle_group): first the dependencies of all of them, then the preparation step of each one (e.g., generating files that the host includes), then the host, and then the fragments.

An optional dependency is active when it is present, enabled (if it has an enabled configuration flag), and accepted by the hook optional_dep_active/1 of the bundle, if it defines one (e.g., a reduced version of the bundle may accept none). The hooks of a bundle can generate its configuration facts for its active optional dependencies with generate_config_auto/2 (see builder_aux), and a host builds only its active fragments.

Use make_bundlereg/3 for processing of Manifest.pl files into bundle registry entries. Bundle registries are written using fastrw so that the support code to load them is minimal. They include cheaper runtime meta-information (like dependencies, versions, path aliases, etc.).

For registered bundles, you can use ensure_load_manifest/1 and manifest_call/2 for loading and consulting a bundle specification.

NOTE: Users should never call custom build command definitions directly with manifest_call/2. Use builder_cmds instead.

Location of bundles and manifests

Usage:is_bundledir(BundleDir)

BundleDir is the directory for a bundle (i.e., contains a Manifest.pl file

Usage:manifest_bundle_name(BundleDir,Bundle)

Bundle is the name declared in the manifest of the bundle at BundleDir (its first sentence, :- bundle(Bundle)). Fails with an error message if there is none.

Usage:lookup_bundle_root(File,BundleDir)

Detect the bundle root dir for the given File (a directory or normal file)

Load manifest and hooks

Usage:ensure_load_manifest(Target)

Ensure that the manifest for Target is loaded (including Manifest sentences and .hooks.pl modules). The bundle must have been scanned before, so that its source directory is known.

Call predicates from manifests

Usage:manifest_call(Target,Head)

Call Target:Head, a member of (a trait of the alias) bundledef for the bundle or item Target (a fact of its Manifest or a clause of its hooks; see obj_invoke/3)

Usage:manifest_current_predicate(Target,Head)

Head is declared in Target (see obj_defines/3)

No further documentation available for this predicate.

No further documentation available for this predicate.

No further documentation available for this predicate.

Manifest to bundlereg compiler

Usage:make_bundlereg(Bundle,BundleDir,RegFile)

Generate a bundlereg RegFile for bundle Bundle at BundleDir. It has no path to the bundle, which is found by name (see internals:bundle_lookup/3), and its alias paths are relative to the bundle (as in the manifest), so that it does not depend on where the workspace or the bundle is.

Display bundle info

Usage:bundle_info_src(Bundle)

Show the source directory of Bundle (one line, for tools)

PREDICATEbundle_info/1

Usage:bundle_info(Bundle)

Show info of Bundle

Enumerate bundle documentation

No further documentation available for this predicate.

No further documentation available for this predicate.

No further documentation available for this predicate.

No further documentation available for this predicate.