Dub

The Dub class helps in getting the applications dependencies up and running. An instance manages one application.

class Dub {}

Constructors

this
this(PackageSupplier[] additional_package_suppliers, string root_path)

Initiales the package manager for the vibe application under root.

this
this(Path override_path)

Initializes DUB with only a single search path

Members

Functions

addLocalPackage
void addLocalPackage(string path, string ver, bool system)
Undocumented in source. Be warned that the author may not have intended to support it.
addSearchPath
void addSearchPath(string path, bool system)
Undocumented in source. Be warned that the author may not have intended to support it.
cachedPackages
string[string] cachedPackages()

Returns all cached packages as a "packageId" = "version" associative array

cleanCaches
void cleanCaches()

cleans all metadata caches

cleanPackage
void cleanPackage(Path path)

Cleans intermediate/cache files of the given package

createEmptyPackage
void createEmptyPackage(Path path, string[] deps, string type)
Undocumented in source. Be warned that the author may not have intended to support it.
describeProject
void describeProject(BuildPlatform platform, string config)

Outputs a JSON description of the project, including its dependencies.

fetch
Package fetch(string packageId, Dependency dep, PlacementLocation location, FetchOptions options, string reason)

Fetches the package matching the dependency and places it in the specified location.

generateProject
void generateProject(string ide, GeneratorSettings settings)

Generate project files for a specified IDE. Any existing project files will be overridden.

getDefaultConfiguration
string getDefaultConfiguration(BuildPlatform platform, bool allow_non_library_configs)
Undocumented in source. Be warned that the author may not have intended to support it.
loadPackage
void loadPackage(Path path)

Loads the package from the specified path as the main project package.

loadPackage
void loadPackage(Package pack)

Loads a specific package as the main project package (can be a sub package)

loadPackageFromCwd
void loadPackageFromCwd()

Loads the package from the current working directory as the main project package.

overrideSearchPath
void overrideSearchPath(Path path)
Undocumented in source. Be warned that the author may not have intended to support it.
remove
void remove(Package pack, bool force_remove)

Removes a given package from the list of present/cached modules. @removeFromApplication: if true, this will also remove an entry in the list of dependencies in the application's dub.json

remove
void remove(string package_id, string version_, PlacementLocation location_, bool force_remove)

This will remove a given package with a specified version from the location. It will remove at most one package, unless @param version_ is specified as wildcard "*". @param package_id Package to be removed @param version_ Identifying a version or a wild card. An empty string may be passed into. In this case the package will be removed from the location, if there is only one version retrieved. This will throw an exception, if there are multiple versions retrieved. Note: as wildcard string only RemoveVersionWildcard ("*") is supported. @param location_

removeLocalPackage
void removeLocalPackage(string path, bool system)
Undocumented in source. Be warned that the author may not have intended to support it.
removeSearchPath
void removeSearchPath(string path, bool system)
Undocumented in source. Be warned that the author may not have intended to support it.
runDdox
void runDdox(bool run)
Undocumented in source. Be warned that the author may not have intended to support it.
shutdown
void shutdown()

Perform cleanup and persist caches to disk

testProject
void testProject(GeneratorSettings settings, string config, Path custom_main_file)

Executes tests on the current project. Throws an exception, if unittests failed.

upgrade
void upgrade(UpgradeOptions options)
Undocumented in source. Be warned that the author may not have intended to support it.

Manifest constants

RemoveVersionWildcard
enum RemoveVersionWildcard;

@see remove(string, string, RemoveLocation)

Properties

configurations
string[] configurations [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
dryRun
bool dryRun [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
packageManager
inout(PackageManager) packageManager [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
project
inout(Project) project [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
projectName
string projectName [@property getter]

Returns the name listed in the dub.json of the current application.

projectPath
Path projectPath [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
rootPath
Path rootPath [@property getter]
Path rootPath [@property setter]

Returns the root path (usually the current working directory).

Meta