Foundry.Config

g Foundry.Config Foundry.Config Foundry.Contextual Foundry.Contextual Foundry.Contextual->Foundry.Config GObject.GInterface GObject.GInterface Json.Serializable Json.Serializable GObject.GInterface->Json.Serializable GObject.Object GObject.Object GObject.Object->Foundry.Contextual Json.Serializable->Foundry.Contextual

Subclasses:

None

Methods

Inherited:

Foundry.Contextual (4), GObject.Object (37), Json.Serializable (8)

Structs:

GObject.ObjectClass (5)

can_default ()

change_sdk (sdk)

dup_build_system ()

dup_builddir (pipeline)

dup_config_opts ()

dup_default_command ()

dup_environ (locality)

dup_id ()

dup_name ()

dup_provider ()

get_active ()

resolve_sdk (device)

save ()

set_id (id)

set_name (name)

supports_sdk (sdk)

Virtual Methods

Inherited:

GObject.Object (7), Json.Serializable (5)

do_can_default ()

do_change_sdk (sdk)

do_dup_build_system ()

do_dup_builddir (pipeline)

do_dup_config_opts ()

do_dup_default_command ()

do_dup_environ (locality)

do_resolve_sdk (device)

do_save ()

do_supports_sdk (sdk)

Properties

Inherited:

Foundry.Contextual (1)

Name

Type

Flags

Short Description

active

bool

r

build-system

str

r

can-default

bool

r

config-opts

[str]

r

id

str

r/w/en

name

str

r/w/en

priority

int

r

provider

Foundry.ConfigProvider

r

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Foundry.Contextual

r

Class Details

class Foundry.Config(**kwargs)
Bases:

Foundry.Contextual

Abstract:

Yes

Structure:

Foundry.ConfigClass

An abstract base class for build configurations.

can_default()
Returns:

True if self can be the default configuration when loading a project for the first time.

priority:

the priority of the configuration

Return type:

(bool, priority: int)

change_sdk(sdk)
Parameters:

sdk (Foundry.Sdk) – a [class`Foundry`.Sdk]

Returns:

a [class`Dex`.Future] that resolves to any value or rejects with error.

Return type:

Dex.Future

Change the SDK for the config and write the config to disk.

New in version 1.1.

dup_build_system()
Returns:

a build system or None

Return type:

str or None

The build system the configuration specifies to be used.

dup_builddir(pipeline)
Parameters:

pipeline (Foundry.BuildPipeline) – the [class`Foundry`.BuildPipeline] which will perform the build

Returns:

the directory where the build should occur

Return type:

str

Determines where the project build should occur.

dup_config_opts()
Returns:

the config options for configuring the project.

Return type:

[str] or None

The config options.

This is generally passed to something like meson setup or cmake when configuring the project for a build.

dup_default_command()
Returns:

a [class`Foundry`.Config] or None.

Return type:

Foundry.Command or None

Gets the default command for the config, if any.

dup_environ(locality)
Parameters:

locality (Foundry.Locality) –

Returns:

an array of UTF-8 encoded strings or None to use the default environment.

Return type:

[str] or None

Gets the environment variables to use for a particular locality.

dup_id()
Returns:

the identifier of the config

Return type:

str or None

dup_name()
Returns:

a newly allocated string

Return type:

str

Gets the user-visible name for the configuration.

dup_provider()
Return type:

Foundry.ConfigProvider or None

Gets the provider which provides this config.

New in version 1.1.

get_active()
Return type:

bool

resolve_sdk(device)
Parameters:

device (Foundry.Device) – a [class`Foundry`.Device]

Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.Sdk] or rejects with error.

Return type:

Dex.Future

Tries to locate the preferred SDK for a configuration and device.

This might be used to locate an SDK which is not yet installed but would need to be installed to properly setup a build pipeline.

save()
Returns:

a [class`Dex`.Future] that resolves to any value or rejects with error.

Return type:

Dex.Future

Requests the config save back to disk.

New in version 1.1.

set_id(id)
Parameters:

id (str) – the unique identifier for the config

Sets the identifier of the config.

This should only be called by [class`Foundry`.ConfigProvider] on their [class`Foundry`.Config] before they have been registered.

set_name(name)
Parameters:

name (str) –

Set the user-visible name of the config.

This should only be called by implementations of Foundry.ConfigProvider.

supports_sdk(sdk)
Parameters:

sdk (Foundry.Sdk) – a [class`Foundry`.Sdk]

Returns:

True if self supports sdk, False otherwise

Return type:

bool

Checks if the configuration supports the given SDK.

This allows configurations to restrict which SDKs they can use. By default, all configurations support all SDKs, but subclasses can override this behavior.

New in version 1.1.

do_can_default() virtual
Returns:

True if self can be the default configuration when loading a project for the first time.

priority:

the priority of the configuration

Return type:

(bool, priority: int)

do_change_sdk(sdk) virtual
Parameters:

sdk (Foundry.Sdk) – a [class`Foundry`.Sdk]

Returns:

a [class`Dex`.Future] that resolves to any value or rejects with error.

Return type:

Dex.Future

Change the SDK for the config and write the config to disk.

New in version 1.1.

do_dup_build_system() virtual
Returns:

a build system or None

Return type:

str or None

The build system the configuration specifies to be used.

do_dup_builddir(pipeline) virtual
Parameters:

pipeline (Foundry.BuildPipeline) – the [class`Foundry`.BuildPipeline] which will perform the build

Returns:

the directory where the build should occur

Return type:

str

Determines where the project build should occur.

do_dup_config_opts() virtual
Returns:

the config options for configuring the project.

Return type:

[str] or None

The config options.

This is generally passed to something like meson setup or cmake when configuring the project for a build.

do_dup_default_command() virtual
Returns:

a [class`Foundry`.Config] or None.

Return type:

Foundry.Command or None

Gets the default command for the config, if any.

do_dup_environ(locality) virtual
Parameters:

locality (Foundry.Locality) –

Returns:

an array of UTF-8 encoded strings or None to use the default environment.

Return type:

[str] or None

Gets the environment variables to use for a particular locality.

do_resolve_sdk(device) virtual
Parameters:

device (Foundry.Device) – a [class`Foundry`.Device]

Returns:

a [class`Dex`.Future] that resolves to a [class`Foundry`.Sdk] or rejects with error.

Return type:

Dex.Future

Tries to locate the preferred SDK for a configuration and device.

This might be used to locate an SDK which is not yet installed but would need to be installed to properly setup a build pipeline.

do_save() virtual
Returns:

a [class`Dex`.Future] that resolves to any value or rejects with error.

Return type:

Dex.Future

Requests the config save back to disk.

New in version 1.1.

do_supports_sdk(sdk) virtual
Parameters:

sdk (Foundry.Sdk) – a [class`Foundry`.Sdk]

Returns:

True if self supports sdk, False otherwise

Return type:

bool

Checks if the configuration supports the given SDK.

This allows configurations to restrict which SDKs they can use. By default, all configurations support all SDKs, but subclasses can override this behavior.

New in version 1.1.

Property Details

Foundry.Config.props.active
Name:

active

Type:

bool

Default Value:

False

Flags:

READABLE

Foundry.Config.props.build_system
Name:

build-system

Type:

str

Default Value:

None

Flags:

READABLE

Foundry.Config.props.can_default
Name:

can-default

Type:

bool

Default Value:

False

Flags:

READABLE

Foundry.Config.props.config_opts
Name:

config-opts

Type:

[str]

Default Value:

[]

Flags:

READABLE

Foundry.Config.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Foundry.Config.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Foundry.Config.props.priority
Name:

priority

Type:

int

Default Value:

0

Flags:

READABLE

Foundry.Config.props.provider
Name:

provider

Type:

Foundry.ConfigProvider

Default Value:

None

Flags:

READABLE