Project

Represents a full project, a root package with its dependencies and package selection.

All dependencies must be available locally so that the package dependency graph can be built. Use Project.reinit if necessary for reloading dependencies after more packages are available.

class Project {}

Constructors

this
deprecated this(PackageManager package_manager, NativePath project_path)
this(PackageManager package_manager, Package pack)
this(PackageManager package_manager, Package pack, SelectedVersions selections)

Loads a project.

Members

Functions

addBuildSettings
void addBuildSettings(BuildSettings dst, GeneratorSettings gsettings, string config, Package root_package, bool shallow)

Fills dst with values from this project.

addBuildTypeSettings
void addBuildTypeSettings(BuildSettings dst, GeneratorSettings gsettings, bool for_root_package)

Fills dst with build settings specific to the given build type.

addTestRunnerConfiguration
string addTestRunnerConfiguration(GeneratorSettings settings, bool generate_main, string base_config, NativePath custom_main_file)

Adds a test runner configuration for the root package.

describe
ProjectDescription describe(GeneratorSettings settings)

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

getDefaultConfiguration
string getDefaultConfiguration(BuildPlatform platform, bool allow_non_library_configs)

Returns the name of the default build configuration for the specified target platform.

getDependency
inout(Package) getDependency(string name, bool is_optional)

Retrieves a particular dependency by name.

getPackageConfigs
string[string] getPackageConfigs(BuildPlatform platform, string config, bool allow_non_library)

Returns a map with the configuration for all packages in the dependency tree.

getTopologicalPackageList
int delegate(int delegate(ref Package)) getTopologicalPackageList(bool children_first, Package root_package, string[string] configs)
int delegate(int delegate(ref const Package)) getTopologicalPackageList(bool children_first, Package root_package, string[string] configs)

Allows iteration of the dependency tree in topological order

getUpgradeCache
deprecated Dependency[string] getUpgradeCache()
Undocumented in source. Be warned that the author may not have intended to support it.
hasAllDependencies
bool hasAllDependencies()

Determines if all dependencies necessary to build have been collected.

isUpgradeCacheUpToDate
deprecated bool isUpgradeCacheUpToDate()
Undocumented in source. Be warned that the author may not have intended to support it.
listBuildSettings
string[] listBuildSettings(GeneratorSettings settings, string[] requestedData, ListBuildSettingsFormat list_type)

Outputs requested data for the project, optionally including its dependencies.

missingDependencies
string[] missingDependencies()

Sorted list of missing dependencies.

overrideConfiguration
void overrideConfiguration(string package_, string config)

Overrides the configuration chosen for a particular package in the dependency graph.

reinit
void reinit()

Reloads dependencies

saveSelections
void saveSelections()

Saves the currently selected dependency versions to disk.

validate
void validate()

Performs basic validation of various aspects of the package.

Properties

builds
string[] builds [@property getter]

Returns the names of all built-in and custom build types of the root package. The default built-in build type is the first item in the list.

configurations
string[] configurations [@property getter]

Returns the names of all configurations of the root package.

dependencies
const(Package[]) dependencies [@property getter]

List of all resolved dependencies.

name
string name [@property getter]

Returns the name of the root package.

packageManager
deprecated inout(PackageManager) packageManager [@property getter]

Package manager instance used by the project.

rootPackage
inout(Package) rootPackage [@property getter]

The root package of the project.

selections
inout(SelectedVersions) selections [@property getter]

The versions to use for all dependencies. Call reinit() after changing these.

Static functions

loadSelections
SelectedVersions loadSelections(NativePath packPath, PackageManager mgr)

Loads a project's dub.selections.json and returns it

Meta