Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dub.loadPackage: Error out if no recipe is found #2772

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion source/dub/dub.d
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,9 @@ class Dub {
/// Loads the package from the specified path as the main project package.
void loadPackage(NativePath path)
{
m_project = new Project(m_packageManager, path);
auto pack = this.m_packageManager.getOrLoadPackage(
path, NativePath.init, false, StrictMode.Warn);
this.loadPackage(pack);
}

/// Loads a specific package as the main project package (can be a sub package)
Expand Down
1 change: 1 addition & 0 deletions source/dub/project.d
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Project {
project_path = Path of the root package to load
pack = An existing `Package` instance to use as the root package
*/
deprecated("Load the package using `PackageManager.getOrLoadPackage` then call the `(PackageManager, Package)` overload")
this(PackageManager package_manager, NativePath project_path)
{
Package pack;
Expand Down
6 changes: 0 additions & 6 deletions source/dub/test/base.d
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,6 @@ public class TestDub : Dub
return new MockPackageSupplier(url);
}

/// Loads the package from the specified path as the main project package.
public override void loadPackage(NativePath path)
{
assert(0, "Not implemented");
}

/// Loads a specific package as the main project package (can be a sub package)
public override void loadPackage(Package pack)
{
Expand Down
Loading