SelectedVersions

Holds and stores a set of version selections for package dependencies.

This is the runtime representation of the information contained in "dub.selections.json" within a package's directory.

Note that as subpackages share the same version as their main package, this class will treat any subpackage reference as a reference to its main package.

Constructors

this
this(uint version_)

Constructs a new empty version selection.

this
this(Selections!1 data)

Constructs a new non-empty version selection.

this
deprecated this(Json data)

Constructs a new version selection from JSON data.

this
deprecated this(NativePath path)

Constructs a new version selections from an existing JSON file.

Members

Functions

clear
void clear()

Removes all selections.

deselectVersion
deprecated void deselectVersion(string package_id)
void deselectVersion(PackageName name)

Removes the selection for a particular package.

getSelectedVersion
deprecated Dependency getSelectedVersion(string packageId)
Dependency getSelectedVersion(PackageName name)

Returns the selection for a particular package.

hasSelectedVersion
deprecated bool hasSelectedVersion(string packageId)
bool hasSelectedVersion(PackageName name)

Determines if a particular package has a selection set.

save
deprecated void save(NativePath path)

Stores the selections to disk.

selectVersion
deprecated void selectVersion(string package_id, Version version_)
void selectVersion(PackageName name, Version version_)

Selects a certain version for a specific package.

selectVersion
deprecated void selectVersion(string package_id, NativePath path)
void selectVersion(PackageName name, NativePath path)

Selects a certain path for a specific package.

selectVersion
deprecated void selectVersion(string package_id, Repository repository)
void selectVersion(PackageName name, Repository repository)

Selects a certain Git reference for a specific package.

selectVersionWithRepository
deprecated void selectVersionWithRepository(string package_id, Repository repository, string spec)
Undocumented in source. Be warned that the author may not have intended to support it.
serialize
deprecated Json serialize()
Undocumented in source. Be warned that the author may not have intended to support it.
set
void set(SelectedVersions versions)

Duplicates the set of selected versions from another instance.

Manifest constants

FileVersion
enum FileVersion;
Undocumented in source.
defaultFile
enum defaultFile;

Default file name to use for storing selections.

Properties

bare
bool bare [@property getter]

Determine if this set of selections is still empty (but not cleared).

dirty
bool dirty [@property getter]

Determines if any changes have been made after loading the selections from a file.

selectedPackages
string[] selectedPackages [@property getter]

Returns a list of names for all packages that have a version selection.

Static functions

dependencyFromJson
deprecated Dependency dependencyFromJson(Json j)
Undocumented in source. Be warned that the author may not have intended to support it.
dependencyToJson
deprecated Json dependencyToJson(Dependency d)
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

m_bare
bool m_bare;
Undocumented in source.
m_dirty
bool m_dirty;
Undocumented in source.
m_selections
Selections!1 m_selections;
Undocumented in source.

Meta