engine

package
v0.3.25 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingOptimize      = errors.New("missing optimize")
	ErrUnrecognizedOptimize = errors.New("unrecognized optimize")
)
View Source
var (
	ErrMissingProfile      = errors.New("missing profile")
	ErrUnrecognizedProfile = errors.New("unrecognized profile")
)
View Source
var (
	ErrConflictingValue = errors.New("conflicting setting")
	ErrInvalidInput     = errors.New("invalid input")
	ErrMissingInput     = errors.New("missing input")
)

Functions

func EditorName

func EditorName() string

EditorName returns the expected name of the Godot editor executable based on the host platform.

func InstallEditor

func InstallEditor(ctx context.Context, v Version, out string) error

InstallEditor installs the Godot editor to the specified directory.

Types

type Optimize

type Optimize uint

Optimize is the level of optimization for a Godot export template.

const (
	OptimizeUnknown Optimize = iota
	OptimizeCustom
	OptimizeDebug
	OptimizeNone
	OptimizeSize
	OptimizeSpeed
	OptimizeSpeedTrace
)

func MustParseOptimize

func MustParseOptimize(input string) Optimize

Parses an input string as an operating system specification but panics if it would fail.

func ParseOptimize

func ParseOptimize(input string) (Optimize, error)

Parses an input string as an operating system specification.

NOTE: This is a best effort implementation. Please open an issue on GitHub if some values are missing: github.com/coffeebeats/gdbuild/issues/new?labels=bug&template=%F0%9F%90%9B-bug-report.md.

func (Optimize) String

func (o Optimize) String() string

String implements 'fmt.Stringer' for 'Optimize' according to the optimization levels passed to SCons during compilation.

func (*Optimize) UnmarshalText

func (o *Optimize) UnmarshalText(bb []byte) error

type Profile

type Profile uint

Optimization levels supported by Godot.

const (
	ProfileUnknown Profile = iota
	ProfileDebug
	ProfileReleaseDebug
	ProfileRelease
)

func MustParseProfile

func MustParseProfile(input string) Profile

Parses an input string as a build profile specification but panics if it would fail.

func ParseProfile

func ParseProfile(input string) (Profile, error)

Parses an input string as a build 'Profile' optimization level.

func (Profile) IsRelease

func (p Profile) IsRelease() bool

IsRelease returns whether the profile setting is a "release" type.

func (Profile) String

func (p Profile) String() string

String implements 'fmt.Stringer' for 'Profile' according to the profile names passed to SCons during compilation.

func (Profile) TargetName

func (p Profile) TargetName() string

TargetName returns the name of the 'SCons' build target for 'Godot'.

func (*Profile) UnmarshalText

func (p *Profile) UnmarshalText(bb []byte) error

type Source

type Source struct {
	// PathSource is a path to a directory containing the Godot source code.
	PathSource osutil.Path `hash:"ignore" toml:"src_path"`
	// Version is a specific version label to download.
	Version Version `toml:"version"`
	// VersionFile is a file containing just the a version label to download.
	VersionFile osutil.Path `hash:"ignore" toml:"version_file"`
}

Source defines options and settings for which Godot version to use. Note that only one of these options can be used at a time, but one *must* be specified.

func (*Source) IsEmpty

func (c *Source) IsEmpty() bool

IsEmpty returns whether all properties are unset, implying there is no need to vendor Godot source code.

func (*Source) ParseVersion

func (c *Source) ParseVersion() (Version, error)

ParseVersion determines the 'Godot' version from the underlying 'Source' configuration. Returns an 'ErrConflictingValue' when a source path is set on the struct instead of a version specification.

func (*Source) VendorTo

func (c *Source) VendorTo(ctx context.Context, out string) error

VendorTo vendors the Godot source code to the specified directory.

type Version

type Version version.Version

Version is a type wrapper around a 'version.Version' struct from 'gdenv'.

func (Version) IsZero

func (v Version) IsZero() bool

IsZero returns whether the 'Version' struct is equal to the zero value.

func (Version) String

func (v Version) String() string

func (*Version) UnmarshalText

func (v *Version) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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