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
(
NativePath path
,
NativePath recipe_path = NativePath.init
,
bool allow_sub_packages = false
)

Parameters

path

NativePath to the root directory of the package

recipe_path

Optional path to the recipe file of the package

allow_sub_packages
Type: 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