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 GeneratorSettings gsettings, string config, in Package root_package = null, bool shallow = false)

Fills dst with values from this project.

addBuildTypeSettings
void addBuildTypeSettings(ref BuildSettings dst, in GeneratorSettings gsettings, bool for_root_package = true)

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

configurations
string[] configurations()

Returns the names of all configurations of the root package.

dependencies
const(Package[]) dependencies()

List of all resolved dependencies.

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

hasAllDependencies
bool hasAllDependencies()

Determines if all dependencies necessary to build have been collected.

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.

name
string name()

Returns the name of the root package.

overrideConfiguration
void overrideConfiguration(string package_, string config)

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

packageManager
inout(PackageManager) packageManager()

Package manager instance used by the project.

reinit
void reinit()

Reloads dependencies.

rootPackage
inout(Package) rootPackage()

The root package of the project.

saveSelections
void saveSelections()

Saves the currently selected dependency versions to disk.

selections
inout(SelectedVersions) selections()

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

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.

Meta