PackageManager.getOrLoadPackage

For a given package path, returns the corresponding package.

If the package is already loaded, a reference is returned. Otherwise the package gets loaded and cached for the next call to this function.

class PackageManager
getOrLoadPackage
(
Path path
,
Path recipe_path = Path.init
,
bool allow_sub_packages = false
)

Parameters

path Path

Path to the root directory of the package

recipe_path Path

Optional path to the recipe file of the package

allow_sub_packages bool

Also return a sub package if it resides in the given folder

Return Value

Type: Package

The packages loaded from the given path

Throws

Throws an exception if no package can be loaded

Meta