Skip to main content

XpmBuildConfigurations.get() method

Retrieves a build configuration by name, creating it if required.

Signature

get(buildConfigurationName: string): XpmBuildConfiguration;

Parameters

Parameter

Type

Description

buildConfigurationName

string

The build configuration name to retrieve.

Returns

XpmBuildConfiguration

The build configuration instance.

Exceptions

XpmInputError If a configuration with the specified name does not exist.

Remarks

This method implements lazy evaluation to avoid unnecessary operations. Build configurations are instantiated on demand but remain uninitialised until actually used.

Retrieval process:

  1. Check if the configuration already exists in the internal map.
  2. If found and already instantiated, return the existing instance.
  3. If the configuration name is unknown (not in JSON name mapping), throw XpmInputError.
  4. For known but not yet instantiated configurations:
    • Resolve the original JSON configuration name (handles both regular and template-generated configurations).
    • Retrieve the JSON configuration definition.
    • Create a new XpmBuildConfiguration instance.
    • Store the instance in the map for future access.
  5. Return the configuration instance (still uninitialised).

The two-step lazy evaluation process:

  1. During collection initialisation (XpmBuildConfigurations.initialise()), only the matrix of options is evaluated for each template, expanding configuration names without processing their content.
  2. Later, when a configuration is accessed via this method and subsequently initialised (XpmBuildConfiguration.initialise()), the template is fully evaluated and Liquid substitutions are performed on all properties.

This approach ensures that only build configurations that are actually used incur the cost of template evaluation and variable substitution.


Generated via tsdoc2docusaurus 1.3.0-pre by API Extractor/Documenter 7.55.2.