Skip to content

Commit 4f0a1a3

Browse files
committed
Move PlacementLocation from project to PackageManager
PlacementLocation define which local path is used for storing packages. It has nothing to do with project (it's not even used there), and should be contained inside PackageManager, even if currently quite a few details are leaking all over the place.
1 parent 7ebb5f4 commit 4f0a1a3

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

source/dub/packagemanager.d

+13
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@ import std.string;
2727
import std.zip;
2828

2929

30+
/// Indicates where a package has been or should be placed to.
31+
public enum PlacementLocation {
32+
/// Packages retrieved with 'local' will be placed in the current folder
33+
/// using the package name as destination.
34+
local,
35+
/// Packages with 'userWide' will be placed in a folder accessible by
36+
/// all of the applications from the current user.
37+
user,
38+
/// Packages retrieved with 'systemWide' will be placed in a shared folder,
39+
/// which can be accessed by all users of the system.
40+
system,
41+
}
42+
3043
/// The PackageManager can retrieve present packages and get / remove
3144
/// packages.
3245
class PackageManager {

source/dub/project.d

+2-13
Original file line numberDiff line numberDiff line change
@@ -1294,19 +1294,8 @@ enum ListBuildSettingsFormat {
12941294
commandLineNul, /// NUL character separated list entries (unescaped, data lists separated by two NUL characters)
12951295
}
12961296

1297-
1298-
/// Indicates where a package has been or should be placed to.
1299-
enum PlacementLocation {
1300-
/// Packages retrieved with 'local' will be placed in the current folder
1301-
/// using the package name as destination.
1302-
local,
1303-
/// Packages with 'userWide' will be placed in a folder accessible by
1304-
/// all of the applications from the current user.
1305-
user,
1306-
/// Packages retrieved with 'systemWide' will be placed in a shared folder,
1307-
/// which can be accessed by all users of the system.
1308-
system
1309-
}
1297+
deprecated("Use `dub.packagemanager : PlacementLocation` instead")
1298+
public alias PlacementLocation = dub.packagemanager.PlacementLocation;
13101299

13111300
void processVars(ref BuildSettings dst, in Project project, in Package pack,
13121301
BuildSettings settings, in GeneratorSettings gsettings, bool include_target_settings = false)

0 commit comments

Comments
 (0)