Modules can depend on specific versions of GameBox or other modules.
Declaration
Module dependencies are declared in the module’s module.yml file. A list of dependencies can be given where each entry defines a specific module by its ID and optionally constrains the needed version to some version range. Modules can use the module ID gamebox to depend on a specific version of GameBox.
dependencies:
- id: "gamebox"
versionConstrain: "~> 1.0"
- id: "some-dependency"
versionConstrain: "~> 1.0, >= 1.2"
- id: "soft-dependency"
versionConstrain: "~>1.5"
softDependency: true
Module ID
The unique ID of the dependency. This identifier has to be known for every dependency.
Version constrains
The setting versionConstrain can be a list of several constrains that can use one of the following operators:
>- any version that is an update to the specified one<- any version the specified one is an update to>=- the specified version or any update of it<=- the specified version or any previous one=," "- an equal sign (or no operator) asks for the given specific version~>- The Twiddle Wakka
RubyGems guide on pessimistic version constraint
Soft dependencies
The dependency list of all modules is used to create the order of loading. If a dependency is missing, the module will usually not be loaded.
To indicate that a dependency can be used if it is installed, but is not critical for the module, one can set softDependency to true. An installed soft dependency will load before the module. If a soft dependency is not installed, the module is still loaded.