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.

basePackage
inout(Package) basePackage()

Returns the base package of this package.

configurations
string[] configurations()

Returns the list of all build configuration names.

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.

metadataCache
Json metadataCache()

Get the metadata cache for this package

metadataCache
void metadataCache(Json json)

Write metadata cache for this package

name
string name()

Returns the qualified name of the package.

parentPackage
inout(Package) parentPackage()

Returns the parent of this package.

path
NativePath path()

Returns the directory in which the package resides.

rawRecipe
const(PackageRecipe) rawRecipe()

Accesses the original package recipe.

recipe
inout(PackageRecipe) recipe()

Accesses the recipe contents of this package.

recipePath
NativePath recipePath()

Returns the path to the package recipe file.

storeInfo
void storeInfo()
void storeInfo(NativePath path)

Writes the current recipe contents to a recipe file.

subPackages
inout(SubPackage)[] subPackages()

Returns the list of all sub packages.

version_
Version version_()
void version_(Version value)

Accesses the version associated with this package.

warnOnSpecialCompilerFlags
void warnOnSpecialCompilerFlags()

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

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