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
this(PackageManager package_manager, NativePath project_path)
this(PackageManager package_manager, Package pack)

Loads a project.

Members

Functions

addBuildSettings
void addBuildSettings(ref BuildSettings dst, in BuildPlatform platform, string config, in Package root_package = null, bool shallow = false)

Fills dst with values from this project.

addBuildTypeSettings
void addBuildTypeSettings(ref BuildSettings dst, in BuildPlatform platform, string build_type, bool for_root_package = true)

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

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 = true)

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(in BuildPlatform platform, string config, bool allow_non_library = true)

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

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

Allows iteration of the dependency tree in topological order

getUpgradeCache
Dependency[string] getUpgradeCache()

Returns the currently cached upgrade information.

hasAllDependencies
bool hasAllDependencies()

Determines if all dependencies necessary to build have been collected.

isUpgradeCacheUpToDate
bool isUpgradeCacheUpToDate()

Checks if the cached upgrade information is still considered up to date.

listBuildSettings
string[] listBuildSettings(GeneratorSettings settings, string[] requestedData, ListBuildSettingsFormat list_type)

Outputs requested data for the project, optionally including its 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.

setUpgradeCache
void setUpgradeCache(Dependency[string] versions)

Sets a new set of versions for the upgrade cache.

validate
void validate()

Performs basic validation of various aspects of the package.

Properties

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
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.

Meta