template

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidInput = errors.New("invalid input")
	ErrMissingInput = errors.New("missing input")
)

Functions

func NewCopyImageFileAction

func NewCopyImageFileAction(
	pathImage osutil.Path,
	bc *build.Context,
) action.WithDescription[action.Function]

NewCopyImageFileAction creates an 'action.Action' which places the specified icon image into the Godot source code.

Types

type Base

type Base struct {
	// Arch is the CPU architecture of the Godot export template.
	Arch platform.Arch `toml:"arch"`
	// CustomModules is a list of paths to custom modules to include in the
	// template build.
	CustomModules []osutil.Path `toml:"custom_modules"`
	// DoublePrecision enables double floating-point precision.
	DoublePrecision *bool `toml:"double_precision"`
	// EncryptionKey is the encryption key to embed in the export template.
	EncryptionKey string `toml:"encryption_key"`
	// Env is a map of environment variables to set during the build step.
	Env map[string]string `toml:"env"`
	// Hook defines commands to be run before or after a build step.
	Hook build.Hook `toml:"hook"`
	// Optimize is the specific optimization level for the template.
	Optimize build.Optimize `toml:"optimize"`
	// PathCustomPy is a path to a 'custom.py' file which defines export
	// template build options.
	PathCustomPy osutil.Path `toml:"custom_py_path"`
	// SCons contains build command-related settings.
	SCons build.SCons `toml:"scons"`
}

Base contains platform-agnostic settings for constructing a custom Godot export template.

func (*Base) Configure

func (c *Base) Configure(bc *build.Context) error

func (*Base) MergeInto

func (c *Base) MergeInto(other any) error

func (*Base) Template added in v0.1.3

func (c *Base) Template(src build.Source, bc *build.Context) *build.Template

func (*Base) Validate

func (c *Base) Validate(bc *build.Context) error

type BaseWithoutFeature

type BaseWithoutFeature struct {
	*Base

	Profile map[build.Profile]Base `toml:"profile"`
}

type Linux

type Linux struct {
	*Base

	// UseLLVM determines whether the LLVM compiler is used.
	UseLLVM *bool `toml:"use_llvm"`
}

func (*Linux) Configure

func (c *Linux) Configure(bc *build.Context) error

func (*Linux) MergeInto

func (c *Linux) MergeInto(other any) error

func (*Linux) Template added in v0.1.3

func (c *Linux) Template(g build.Source, bc *build.Context) *build.Template

func (*Linux) Validate

func (c *Linux) Validate(bc *build.Context) error

type LinuxWithFeaturesAndProfile

type LinuxWithFeaturesAndProfile struct {
	*Linux

	Feature map[string]LinuxWithProfile `toml:"feature"`
	Profile map[build.Profile]Linux     `toml:"profile"`
}

type LinuxWithProfile

type LinuxWithProfile struct {
	*Linux

	Profile map[build.Profile]Linux `toml:"profile"`
}

type MacOS

type MacOS struct {
	*Base

	// LipoCommand contains arguments used to invoke 'lipo'. Defaults to
	// ["lipo"]. Only used if 'arch' is set to 'platform.ArchUniversal'.
	LipoCommand []string `toml:"lipo_command"`

	// Vulkan defines Vulkan-related configuration.
	Vulkan Vulkan `toml:"vulkan"`
}

func (*MacOS) Configure

func (c *MacOS) Configure(bc *build.Context) error

func (*MacOS) MergeInto

func (c *MacOS) MergeInto(other any) error

func (*MacOS) Template added in v0.1.3

func (c *MacOS) Template(g build.Source, bc *build.Context) *build.Template

func (*MacOS) Validate

func (c *MacOS) Validate(bc *build.Context) error

type MacOSWithFeaturesAndProfile

type MacOSWithFeaturesAndProfile struct {
	*MacOS

	Feature map[string]MacOSWithProfile `toml:"feature"`
	Profile map[build.Profile]MacOS     `toml:"profile"`
}

type MacOSWithProfile

type MacOSWithProfile struct {
	*MacOS

	Profile map[build.Profile]MacOS `toml:"profile"`
}

type Platforms

type Platforms struct {
	Linux   LinuxWithFeaturesAndProfile   `toml:"linux"`
	MacOS   MacOSWithFeaturesAndProfile   `toml:"macos"`
	Windows WindowsWithFeaturesAndProfile `toml:"windows"`
}

type Template

type Template interface {
	config.Configurable[*build.Context]

	Template(src build.Source, bc *build.Context) *build.Template
}

type Templates

type Templates struct {
	*Base

	Platform Platforms                     `toml:"platform"`
	Feature  map[string]BaseWithoutFeature `toml:"feature"`
	Profile  map[build.Profile]Base        `toml:"profile"`
}

Template 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) Build

func (t *Templates) Build(bc *build.Context) (Template, error)

type Vulkan

type Vulkan struct {
	// Dynamic enables dynamically linking Vulkan to the template.
	Dynamic *bool `toml:"use_volk"`

	// PathSDK is the path to the Vulkan SDK root.
	PathSDK osutil.Path `toml:"sdk_path"`
}

Vulkan defines the settings required by the MacOS template for including Vulkan support.

func (*Vulkan) Configure

func (c *Vulkan) Configure(bc *build.Context) error

func (*Vulkan) Validate

func (c *Vulkan) Validate(_ *build.Context) error

type Windows

type Windows struct {
	*Base

	// UseMinGW determines whether the MinGW compiler is used.
	UseMinGW *bool `toml:"use_mingw"`

	// PathIcon is a path to a Windows application icon.
	PathIcon osutil.Path `toml:"icon_path"`
}

func (*Windows) Configure

func (c *Windows) Configure(bc *build.Context) error

func (*Windows) MergeInto

func (c *Windows) MergeInto(other any) error

func (*Windows) Template added in v0.1.3

func (c *Windows) Template(g build.Source, bc *build.Context) *build.Template

func (*Windows) Validate

func (c *Windows) Validate(bc *build.Context) error

type WindowsWithFeaturesAndProfile

type WindowsWithFeaturesAndProfile struct {
	*Windows

	Feature map[string]WindowsWithProfile `toml:"feature"`
	Profile map[build.Profile]Windows     `toml:"profile"`
}

type WindowsWithProfile

type WindowsWithProfile struct {
	*Windows

	Profile map[build.Profile]Windows `toml:"profile"`
}

Jump to

Keyboard shortcuts

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