PackageConfig constructor
Creats a package configuration with the provided available packages
.
The packages must be valid packages (valid package name, valid absolute directory URIs, valid language version, if any), and there must not be two packages with the same name.
The package's root (Package.rootUri
) and package-root
(Package.packageUriRoot) paths must satisfy a number of constraints
We say that one path (which we know ends with a /
charater)
is inside another path, if the latter path is a prefix of the former path,
including the two paths being the same.
- No package's root must be the same as another package's root.
- The package-root of a package must be inside the pacakge's root.
- If one package's package-root is inside another package's root, then the latter package's package root must not be inside the former package's root. (No getting between a package and its package root!) This also disallows a package's root being the same as another package's package root.
If supplied, the extraData
will be available as the
PackageConfig.extraData
of the created configuration.
The version of the resulting configuration is always maxVersion.
Implementation
factory PackageConfig(Iterable<Package> packages, {Object? extraData}) =>
SimplePackageConfig(maxVersion, packages, extraData);