Deprecate `Package.load`, use `PackageManager.load` instead
In order for the dependency injection approach to work,
we need to be able to override every single instance of
`Package.load`. We could not override `Package.load` itself
as it is a static function.
However, in the process of adding support for path-based dependencies
to the test suite, it became obvious that the functionality offered
by `Package.load` is actually better suited for the `PackageManager`.
Deprecating `Package.load` confirms this: Not a single call was outside
of `PackageManager`, and no extra parameter had to be provided anywhere
to make this work.
This also nicely simplifies the `TestPackageManager` implementation,
as we can now overload `load` and let `getPackage` alone.
1 parent 92da402 commit 834c105f5908c86fccff1025b04f7c17c0ccedd5
@Mathias Lang Mathias Lang authored on 1 Jan 2024
Mathias LANG committed on 2 Jan 2024
Showing 3 changed files
View
source/dub/package_.d
View
source/dub/packagemanager.d
View
source/dub/test/base.d