@@ -162,7 +162,7 @@ class Dub {
162
162
163
163
init(m_rootPath);
164
164
165
- m_packageSuppliers = getPackageSuppliers (additional_package_suppliers, skip_registry);
165
+ m_packageSuppliers = this .computePkgSuppliers (additional_package_suppliers, skip_registry);
166
166
m_packageManager = new PackageManager(m_rootPath, m_dirs.localRepository, m_dirs.systemSettings);
167
167
168
168
auto ccps = m_config.customCachePaths;
@@ -249,7 +249,16 @@ class Dub {
249
249
skip_registry = Can be used to skip using the configured package
250
250
suppliers, as well as the default suppliers.
251
251
*/
252
+ deprecated (" This is an implementation detail. " ~
253
+ " Use `packageSuppliers` to get the computed list of package " ~
254
+ " suppliers once a `Dub` instance has been constructed." )
252
255
public PackageSupplier[] getPackageSuppliers (PackageSupplier[] additional_package_suppliers, SkipPackageSuppliers skip_registry)
256
+ {
257
+ return this .computePkgSuppliers(additional_package_suppliers, skip_registry);
258
+ }
259
+
260
+ // / Ditto
261
+ private PackageSupplier[] computePkgSuppliers (PackageSupplier[] additional_package_suppliers, SkipPackageSuppliers skip_registry)
253
262
{
254
263
PackageSupplier[] ps = additional_package_suppliers;
255
264
@@ -275,6 +284,9 @@ class Dub {
275
284
}
276
285
277
286
// / ditto
287
+ deprecated (" This is an implementation detail. " ~
288
+ " Use `packageSuppliers` to get the computed list of package " ~
289
+ " suppliers once a `Dub` instance has been constructed." )
278
290
public PackageSupplier[] getPackageSuppliers (PackageSupplier[] additional_package_suppliers)
279
291
{
280
292
return getPackageSuppliers (additional_package_suppliers, m_config.skipRegistry);
@@ -285,17 +297,12 @@ class Dub {
285
297
scope (exit) environment.remove(" DUB_REGISTRY" );
286
298
auto dub = new Dub(" ." , null , SkipPackageSuppliers.none);
287
299
288
- dub.m_config.skipRegistry = typeof (dub.m_config.skipRegistry)(SkipPackageSuppliers.none);
289
- assert (dub.getPackageSuppliers(null ).length == 1 );
290
-
291
- dub.m_config.skipRegistry = typeof (dub.m_config.skipRegistry)(SkipPackageSuppliers.configured);
292
- assert (dub.getPackageSuppliers(null ).length == 0 );
293
-
294
- dub.m_config.skipRegistry = typeof (dub.m_config.skipRegistry)(SkipPackageSuppliers.standard);
295
- assert (dub.getPackageSuppliers(null ).length == 0 );
300
+ assert (dub.computePkgSuppliers(null , SkipPackageSuppliers.none).length == 1 );
301
+ assert (dub.computePkgSuppliers(null , SkipPackageSuppliers.configured).length == 0 );
302
+ assert (dub.computePkgSuppliers(null , SkipPackageSuppliers.standard).length == 0 );
296
303
297
304
environment[" DUB_REGISTRY" ] = " http://example.com/" ;
298
- assert (dub.getPackageSuppliers (null ).length == 1 );
305
+ assert (dub.computePkgSuppliers (null , SkipPackageSuppliers.standard ).length == 1 );
299
306
}
300
307
301
308
@property bool dryRun() const { return m_dryRun; }
0 commit comments