config

package
v0.3.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidInput = config.ErrInvalidInput
	ErrMissingInput = config.ErrMissingInput
)
View Source
var ErrConflictingValue = errors.New("conflicting setting")

Functions

func DefaultFilename

func DefaultFilename() string

DefaultFilename returns the default name of the 'gdbuild' manifest file.

func Export added in v0.2.1

func Export(
	rc *run.Context,
	m *Manifest,
	tl *template.Template,
	target string,
) (*export.Export, error)

Export creates an `Export` instance which contains an action for exporting the specified target.

func Init added in v0.2.0

func Init(path string) error

Init initializes a GDBuild manifest at the specified path. Note that 'path' can be a directory or a '.toml' file.

func Template added in v0.2.1

func Template(rc *run.Context, m *Manifest) (*template.Template, error)

Template creates a `Template` instance which contains an action for compiling Godot based on the specified configuration.

Types

type BaseTargetWithoutFeature added in v0.3.20

type BaseTargetWithoutFeature struct {
	*common.Target

	Profile map[engine.Profile]common.Target `toml:"profile"`
}

type BaseTemplateWithoutFeature added in v0.3.20

type BaseTemplateWithoutFeature struct {
	*common.Template

	Profile map[engine.Profile]common.Template `toml:"profile"`
}

type Config

type Config struct {
	// Extends is a path to another GDBuild manifest to extend. Note that value
	// override rules work the same as within a manifest; any primitive values
	// will override those defined in the base configuration, while arrays will
	// be appended to the base configuration's arrays.
	Extends osutil.Path `toml:"extends"`
}

Configs specifies GDBuild manifest-related settings.

type Exporter added in v0.3.20

type Exporter interface {
	config.Configurable[*run.Context]

	Collect(rc *run.Context, tl *template.Template, ev engine.Version) *export.Export
}

type Godot added in v0.2.1

type Godot struct {
	*engine.Source
}

func (*Godot) Configure added in v0.2.1

func (g *Godot) Configure(rc *run.Context) error

func (*Godot) MergeInto added in v0.2.1

func (g *Godot) MergeInto(other any) error

func (*Godot) Validate added in v0.2.1

func (g *Godot) Validate(_ *run.Context) error

type Manifest

type Manifest struct {
	// Config contains GDBuild configuration-related settings.
	Config Config `toml:"config"`
	// Godot contains settings on which Godot version/source code to use.
	Godot Godot `toml:"godot"`
	// Target includes settings for exporting Godot game executables and packs.
	Target map[string]Targets `toml:"target"`
	// Template includes settings for building custom export templates.
	Template Templates `toml:"template"`
}

Manifest defines the supported structure of the GDBuild manifest file.

func Parse

func Parse(bb []byte) (*Manifest, error)

Parse parses a 'Manifest' struct from a 'toml' document.

func ParseFile

func ParseFile(path string) (*Manifest, error)

Parse parses a 'Manifest' struct from a 'toml' file.

type TargetBuilder added in v0.3.20

type TargetBuilder[T Exporter] interface {
	Build(rc *run.Context, dst T) error
}

type TargetPlatforms added in v0.3.20

type TargetPlatforms struct {
	Linux   linux.TargetWithFeaturesAndProfile   `toml:"linux"`
	MacOS   macos.TargetWithFeaturesAndProfile   `toml:"macos"`
	Windows windows.TargetWithFeaturesAndProfile `toml:"windows"`
}

type Targets added in v0.3.20

type Targets struct {
	*common.TargetWithFeaturesAndProfile

	Platform TargetPlatforms `toml:"platform"`
}

Targets defines the parameters for exporting a game binary or pack file for a specified platform. A 'Target' definition can be customized based on 'feature', 'platform', and 'profile' labels used in the property names. Note that each specifier label can only be used once per property name (i.e. 'target.profile.release.profile.debug' is not allowed). Additionally, the order of specifiers is strict: 'platform' < 'feature' < 'profile'.

For example, the following are all valid table names:

[target]
[target.profile.release]
[target.platform.macos.feature.client]
[target.platform.linux.feature.server.profile.release_debug]

func (Targets) Combine added in v0.3.20

func (t Targets) Combine(rc *run.Context) (Exporter, error)

type TemplateBuilder added in v0.3.20

type TemplateBuilder[T Templater] interface {
	Build(rc *run.Context, dst T) error
}

type TemplatePlatforms added in v0.3.20

type TemplatePlatforms struct {
	Linux   linux.TemplateWithFeaturesAndProfile   `toml:"linux"`
	MacOS   macos.TemplateWithFeaturesAndProfile   `toml:"macos"`
	Windows windows.TemplateWithFeaturesAndProfile `toml:"windows"`
}

type Templater added in v0.3.20

type Templater interface {
	config.Configurable[*run.Context]

	Collect(src engine.Source, rc *run.Context) *template.Template
}

type Templates added in v0.3.20

type Templates struct {
	*common.TemplateWithFeaturesAndProfile

	Platform TemplatePlatforms `toml:"platform"`
}

Templates defines the parameters for building a Godot export template for a specified platform. A 'Template' definition can be customized based on 'feature', 'platform', and 'profile' labels used in the property names. Note that each specifier label can only be used once per property name (i.e. 'target.profile.release.profile.debug' is not allowed). Additionally, the order of specifiers is strict: 'platform' < 'feature' < 'profile'.

For example, the following are all valid table names:

[template]
[template.profile.release]
[template.platform.macos.feature.client]
[template.platform.linux.feature.server.profile.release_debug]

func (*Templates) Combine added in v0.3.20

func (t *Templates) Combine(rc *run.Context) (Templater, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL