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

Deprecate Package.getInternalSubPackage, simplify DepedencyResolver #2806

Merged
merged 1 commit into from
Jan 18, 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
13 changes: 1 addition & 12 deletions source/dub/dub.d
Original file line number Diff line number Diff line change
Expand Up @@ -1843,18 +1843,7 @@ private class DependencyVersionResolver : DependencyResolver!(Dependency, Depend
if (!basepack) return null;
if (auto sp = m_dub.m_packageManager.getSubPackage(basepack, subname, true))
return sp;
if (!basepack.subPackages.canFind!(p => p.path.length)) {
// note: external sub packages are handled further below
auto spr = basepack.getInternalSubPackage(subname);
if (!spr.isNull) {
auto sp = new Package(spr.get, basepack.path, basepack);
m_remotePackages[sp.name] = sp;
return sp;
}
logDiagnostic("Sub package %s doesn't exist in %s %s.", name, name.main, dep);
return null;
}
logDiagnostic("External sub package %s %s not found.", name, dep);
logDiagnostic("Subpackage %s@%s not found.", name, dep);
return null;
}

Expand Down
8 changes: 1 addition & 7 deletions source/dub/package_.d
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,7 @@ class Package {
writeJsonFile(filename, m_info.toJson());
}

/** Returns the package recipe of a non-path-based sub package.

For sub packages that are declared within the package recipe of the
parent package, this function will return the corresponding recipe. Sub
packages declared using a path must be loaded manually (or using the
`PackageManager`).
*/
deprecated("Use `PackageManager.getSubPackage` instead")
Nullable!PackageRecipe getInternalSubPackage(string name)
{
foreach (ref p; m_info.subPackages)
Expand Down
3 changes: 0 additions & 3 deletions source/dub/packagemanager.d
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,6 @@ class PackageManager {

/** Gets the a specific sub package.

In contrast to `Package.getSubPackage`, this function supports path
based sub packages.

Params:
base_package = The package from which to get a sub package
sub_name = Name of the sub package (not prefixed with the base
Expand Down
Loading