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 unused getSubPackagePath #2799

Merged
merged 1 commit into from
Jan 14, 2024
Merged
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
9 changes: 7 additions & 2 deletions source/dub/recipe/packagerecipe.d
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,18 @@ import std.process : environment;
example, "packa:packb:packc" references a package named "packc" that is a
sub package of "packb", which in turn is a sub package of "packa".
*/
deprecated("This function is not supported as subpackages cannot be nested")
string[] getSubPackagePath(string package_name) @safe pure
{
return package_name.split(":");
}

deprecated @safe unittest
{
assert(getSubPackagePath("packa:packb:packc") == ["packa", "packb", "packc"]);
assert(getSubPackagePath("pack") == ["pack"]);
}

/**
Returns the name of the top level package for a given (sub) package name of
format `"basePackageName"` or `"basePackageName:subPackageName"`.
Expand All @@ -62,8 +69,6 @@ string getSubPackageName(string package_name) @safe pure

@safe unittest
{
assert(getSubPackagePath("packa:packb:packc") == ["packa", "packb", "packc"]);
assert(getSubPackagePath("pack") == ["pack"]);
assert(getBasePackageName("packa:packb:packc") == "packa");
assert(getBasePackageName("pack") == "pack");
assert(getSubPackageName("packa:packb:packc") == "packb:packc");
Expand Down
Loading