Foundry.Sdk

g Foundry.Contextual Foundry.Contextual Foundry.Sdk Foundry.Sdk Foundry.Contextual->Foundry.Sdk 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)

build_simple (pipeline, argv)

contains_program (program)

discover_shell ()

dup_arch ()

dup_config_option (option)

dup_id ()

dup_kind ()

dup_name ()

get_active ()

get_eol ()

get_extension_only ()

get_installed ()

install (operation, cancellable)

prepare_to_build (pipeline, launcher, phase)

prepare_to_run (pipeline, launcher)

set_arch (arch)

set_extension_only (extension_only)

set_id (id)

set_installed (installed)

set_kind (kind)

set_name (name)

translate_path (pipeline, path)

Virtual Methods

Inherited:

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

do_contains_program (program)

do_dup_config_option (option)

do_get_eol ()

do_install (operation, cancellable)

do_prepare_to_build (pipeline, launcher, phase)

do_prepare_to_run (pipeline, launcher)

do_translate_path (pipeline, path)

Properties

Inherited:

Foundry.Contextual (1)

Name

Type

Flags

Short Description

active

bool

r

arch

str

r/w/en

eol

bool

r

extension-only

bool

r/w/en

id

str

r/w/en

installed

bool

r/w/en

kind

str

r/w/en

name

str

r/w/en

provider

Foundry.SdkProvider

r

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

Foundry.Contextual

r

Class Details

class Foundry.Sdk(**kwargs)
Bases:

Foundry.Contextual

Abstract:

Yes

Structure:

Foundry.SdkClass

Represents a software development kit (SDK).

Foundry.Sdk provides information about available SDKs including their architecture, installation status, and capabilities. It integrates with SDK providers to manage SDK discovery, installation, and configuration for various development platforms and toolchains.

build_simple(pipeline, argv)
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a UTF-8 encoded string or rejects with error.

Return type:

Dex.Future

This is a much simplified interface for [method`Foundry`.Sdk.prepare_to_build] for consumers that just want to run a simple command and get the stdout output of the command.

Use this when you want to quickly run something like program --version when setting up the pipeline.

New in version 1.1.

contains_program(program)
Parameters:

program (str) – the program such as “ps”

Returns:

a [class`Dex`.Future] that resolves to a string containing the path of program.

Return type:

Dex.Future

Looks for program within the SDK.

discover_shell()
Returns:

a [class`Dex`.Future]

Return type:

Dex.Future

Tries to discover the shell to use within the SDK.

This will look at the users preferred shell and try to locate that within the container environment.

dup_arch()
Returns:

a newly allocated string

Return type:

str

Gets the architecture of the SDK.

dup_config_option(option)
Parameters:

option (Foundry.SdkConfigOption) –

Returns:

a string containing the config option or None if unset.

Return type:

str or None

Gets a config option that should be used as the default to work with this particular SDK.

dup_id()
Returns:

a newly allocated string

Return type:

str

Gets the user-visible id for the SDK.

dup_kind()
Returns:

a newly allocated string

Return type:

str

Gets the user-visible kind for the SDK.

dup_name()
Returns:

a newly allocated string

Return type:

str

Gets the user-visible name for the SDK.

get_active()
Return type:

bool

get_eol()
Returns:

True if the SDK has reached end of life, False otherwise

Return type:

bool

Gets whether the SDK has reached end of life.

New in version 1.1.

get_extension_only()
Return type:

bool

get_installed()
Return type:

bool

install(operation, cancellable)
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a boolean.

Return type:

Dex.Future

Installs an SDK.

prepare_to_build(pipeline, launcher, phase)
Parameters:
Returns:

a [class`Dex`.Future]

Return type:

Dex.Future

Prepares launcher to be able to build applications.

That may mean setting things up to access a SDK tooling or other compoonents.

phase is used to differentiate between different types of launchers. For example, you may apply a different environment for building dependencies than for the project itself.

prepare_to_run(pipeline, launcher)
Parameters:
Returns:

a [class`Dex`.Future]

Return type:

Dex.Future

Prepares launcher to be able to run applications.

That may mean setting things up to access a display server, network, or other compoonents.

set_arch(arch)
Parameters:

arch (str) –

Set the architecture of the SDK.

This should only be called by [class`Foundry`.SdkProvider] classes.

set_extension_only(extension_only)
Parameters:

extension_only (bool) –

set_id(id)
Parameters:

id (str) –

Set the unique id of the SDK.

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

set_installed(installed)
Parameters:

installed (bool) –

set_kind(kind)
Parameters:

kind (str) –

Set the user-visible kind of the sdk.

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

set_name(name)
Parameters:

name (str) –

Set the user-visible name of the sdk.

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

translate_path(pipeline, path)
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a [iface`Gio`.File] or rejects with error.

Return type:

Dex.Future

This function should be implemented by SDKs so that you can convert a path within the container to a path outside the container.

For example, if we want to know where to find the location of /usr/share/gir-1.0/GLib-2.0.gir within the SDK (or pipeline build) we could use this function to get a path available from our current environment which might route through file:///var/run/host/....

New in version 1.1.

do_contains_program(program) virtual
Parameters:

program (str) – the program such as “ps”

Returns:

a [class`Dex`.Future] that resolves to a string containing the path of program.

Return type:

Dex.Future

Looks for program within the SDK.

do_dup_config_option(option) virtual
Parameters:

option (Foundry.SdkConfigOption) –

Returns:

a string containing the config option or None if unset.

Return type:

str or None

Gets a config option that should be used as the default to work with this particular SDK.

do_get_eol() virtual
Returns:

True if the SDK has reached end of life, False otherwise

Return type:

bool

Gets whether the SDK has reached end of life.

New in version 1.1.

do_install(operation, cancellable) virtual
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a boolean.

Return type:

Dex.Future

Installs an SDK.

do_prepare_to_build(pipeline, launcher, phase) virtual
Parameters:
Returns:

a [class`Dex`.Future]

Return type:

Dex.Future

Prepares launcher to be able to build applications.

That may mean setting things up to access a SDK tooling or other compoonents.

phase is used to differentiate between different types of launchers. For example, you may apply a different environment for building dependencies than for the project itself.

do_prepare_to_run(pipeline, launcher) virtual
Parameters:
Returns:

a [class`Dex`.Future]

Return type:

Dex.Future

Prepares launcher to be able to run applications.

That may mean setting things up to access a display server, network, or other compoonents.

do_translate_path(pipeline, path) virtual
Parameters:
Returns:

a [class`Dex`.Future] that resolves to a [iface`Gio`.File] or rejects with error.

Return type:

Dex.Future

This function should be implemented by SDKs so that you can convert a path within the container to a path outside the container.

For example, if we want to know where to find the location of /usr/share/gir-1.0/GLib-2.0.gir within the SDK (or pipeline build) we could use this function to get a path available from our current environment which might route through file:///var/run/host/....

New in version 1.1.

Property Details

Foundry.Sdk.props.active
Name:

active

Type:

bool

Default Value:

False

Flags:

READABLE

Foundry.Sdk.props.arch
Name:

arch

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Foundry.Sdk.props.eol
Name:

eol

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the SDK has reached end of life.

New in version 1.1.

Foundry.Sdk.props.extension_only
Name:

extension-only

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Foundry.Sdk.props.id
Name:

id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Foundry.Sdk.props.installed
Name:

installed

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Foundry.Sdk.props.kind
Name:

kind

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Foundry.Sdk.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Foundry.Sdk.props.provider
Name:

provider

Type:

Foundry.SdkProvider

Default Value:

None

Flags:

READABLE