Package

Represents a package, including its sub packages.

class Package {}

Constructors

this
this(Json json_recipe, NativePath root = NativePath(), Package parent = null, string version_override = "")
this(PackageRecipe recipe, NativePath root = NativePath(), Package parent = null, string version_override = "")

Constructs a Package using an in-memory package recipe.

Members

Functions

addBuildTypeSettings
void addBuildTypeSettings(ref BuildSettings settings, in BuildPlatform platform, string build_type)

Adds build type specific settings to an existing set of build settings.

describe
PackageDescription describe(BuildPlatform platform, string config)
PackageDescription describe(BuildPlatform platform, Compiler compiler, string config)

Returns a description of the package for use in IDEs or build tools.

getAllDependencies
PackageDependency[] getAllDependencies()

Returns a list of all possible dependencies of the package.

getBuildSettings
const(BuildSettingsTemplate) getBuildSettings(string config = null)

Retrieves a build settings template.

getBuildSettings
BuildSettings getBuildSettings(in BuildPlatform platform, string config)

Returns all BuildSettings for the given platform and configuration.

getCombinedBuildSettings
BuildSettings getCombinedBuildSettings()

Returns the combination of all build settings for all configurations and platforms.

getDefaultConfiguration
string getDefaultConfiguration(in BuildPlatform platform, bool allow_non_library = false)

Returns the default configuration to build for the given platform.

getDependencies
const(Dependency[string]) getDependencies(string config)

Retrieves all dependencies for a particular configuration.

getInternalSubPackage
Nullable!PackageRecipe getInternalSubPackage(string name)

Returns the package recipe of a non-path-based sub package.

getPlatformConfigurations
string[] getPlatformConfigurations(in BuildPlatform platform, bool allow_non_library = false)

Returns a list of configurations suitable for the given platform.

getSubConfiguration
string getSubConfiguration(string config, in Package dependency, in BuildPlatform platform)

Returns the selected configuration for a certain dependency.

hasDependency
bool hasDependency(string dependency_name, string config)

Determines if the package has a dependency to a certain package.

storeInfo
void storeInfo()
void storeInfo(NativePath path)

Writes the current recipe contents to a recipe file.

warnOnSpecialCompilerFlags
void warnOnSpecialCompilerFlags()

Searches for use of compiler-specific flags that have generic alternatives.

Properties

basePackage
inout(Package) basePackage [@property getter]

Returns the base package of this package.

configurations
string[] configurations [@property getter]

Returns the list of all build configuration names.

name
string name [@property getter]

Returns the qualified name of the package.

parentPackage
inout(Package) parentPackage [@property getter]

Returns the parent of this package.

path
NativePath path [@property getter]

Returns the directory in which the package resides.

rawRecipe
const(PackageRecipe) rawRecipe [@property getter]

Accesses the original package recipe.

recipe
inout(PackageRecipe) recipe [@property getter]

Accesses the recipe contents of this package.

recipePath
NativePath recipePath [@property getter]

Returns the path to the package recipe file.

subPackages
inout(SubPackage)[] subPackages [@property getter]

Returns the list of all sub packages.

version_
Version version_ [@property getter]
Version version_ [@property setter]

Accesses the version associated with this package.

Static functions

findPackageFile
NativePath findPackageFile(NativePath directory)

Searches the given directory for package recipe files.

load
Package load(NativePath root, NativePath recipe_file = NativePath.init, Package parent = null, string version_override = "")

Constructs a Package using a package that is physically present on the local file system.

Meta