Documentation ¶
Index ¶
Constants ¶
const ( EnvSConsCache = "SCONS_CACHE" EnvSConsFlags = "SCONSFLAGS" )
Variables ¶
var ( ErrMissingArch = errors.New("missing architecture") ErrUnrecognizedArch = errors.New("unrecognized architecture") )
var ( // ErrInvalidInput is returned when a function is provided invalid input. ErrInvalidInput = errors.New("invalid input") // ErrMissingInput is returned when a function is missing required input. ErrMissingInput = errors.New("missing input") )
var ( ErrMissingOptimize = errors.New("missing optimize") ErrUnrecognizedOptimize = errors.New("unrecognized optimize") )
var ( ErrMissingOS = errors.New("missing OS") ErrUnrecognizedOS = errors.New("unrecognized OS") )
var ( ErrMissingProfile = errors.New("missing profile") ErrUnrecognizedProfile = errors.New("unrecognized profile") )
var ErrConflictingValue = errors.New("conflicting setting")
ErrConflictingValue is returned when two settings conflict with eachother.
Functions ¶
This section is empty.
Types ¶
type Arch ¶
type Arch uint
CPU architectures which Godot supports targeting.
func MustParseArch ¶
Parses an input string as a CPU architecture specification but panics if it would fail.
func ParseArch ¶
Parses an input string as a CPU architecture 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 (Arch) String ¶
String implements 'fmt.Stringer' for 'Arch' according to the architecture names passed to SCons during compilation.
func (*Arch) UnmarshalText ¶
type Configurer ¶
type Configurer interface {
Configure(i *Invocation) error
}
Configurer is a type which can configure itself based on the current invocation.
type Godot ¶
type Godot struct { // PathSource is a path to a directory containing the Godot source code. PathSource Path `toml:"src_path"` // Version is a specific version label to download. Version string `toml:"version"` // VersionFile is a file containing just the a version label to download. VersionFile Path `toml:"version_file"` }
Godot 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 (*Godot) Configure ¶
func (c *Godot) Configure(inv *Invocation) error
type Hook ¶
type Hook struct { // Pre contains a command to run *before* a build step. Pre []action.Command `toml:"prebuild"` // Post contains a command to run *after* a build step. Post []action.Command `toml:"postbuild"` // Shell defines which shell process to run these commands in. Shell exec.Shell `toml:"shell"` }
Hook contains commands to execute before and after a build step.
TODO: Allow per-hook shell settings.
type Invocation ¶
type Invocation struct { // Verbose determines whether to enable additional logging output. Verbose bool // Features is the list of feature tags to enable. Features []string // Platform is the target platform to build for. Platform OS // Profile is the GDBuild optimization level to build with. Profile Profile // PathBuild is the directory in which to build the template in. All input // artifacts will be copied here and the SCons build command will be // executed within this directory. Defaults to a temporary directory. PathBuild Path // PathManifest is the path to the GDBuild manifest. This is used to locate // relative paths in various other properties. PathManifest Path // PathOut is the directory in which to move built artifacts to. PathOut Path }
Invocation are build command inputs that are invocation-specific. These need to be explicitly set per invocation as they can't be parsed from a GDBuild manifest.
func (*Invocation) BinPath ¶ added in v0.0.4
func (c *Invocation) BinPath() Path
BinPath returns the path to the Godot template artifacts are compilation.
func (*Invocation) Validate ¶
func (c *Invocation) Validate() error
type OS ¶
type OS uint
Operating systems which the Godot project supports building for.
func MustParseOS ¶
Parses an input string as an operating system specification but panics if it would fail.
func ParseOS ¶
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 (OS) String ¶
String implements 'fmt.Stringer' for 'OS' according to the platform names passed to SCons during compilation.
func (*OS) UnmarshalText ¶
type Optimize ¶
type Optimize uint
Optimize is the level of optimization for a Godot export template.
func MustParseOptimize ¶
Parses an input string as an operating system specification but panics if it would fail.
func ParseOptimize ¶
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 ¶
String implements 'fmt.Stringer' for 'Optimize' according to the optimization levels passed to SCons during compilation.
func (*Optimize) UnmarshalText ¶
type Path ¶
type Path string
Path is a string type that's expected to be a path.
func (Path) CheckIsDir ¶
CheckIsDir verifies that the underlying path is a valid directory.
func (Path) CheckIsDirOrEmpty ¶
CheckIsDirOrEmpty verifies that the underlying path is either empty or a valid directory.
func (Path) CheckIsFile ¶ added in v0.0.4
CheckIsFile verifies that the underlying path is a valid file.
func (Path) CheckIsFileOrEmpty ¶
CheckIsFileOrEmpty verifies that the underlying path is either empty or a valid file.
type Profile ¶
type Profile uint
Optimization levels supported by Godot.
func MustParseProfile ¶
Parses an input string as a build profile specification but panics if it would fail.
func ParseProfile ¶
Parses an input string as a build 'Profile' optimization level.
func (Profile) IsRelease ¶ added in v0.0.4
IsRelease returns whether the profile setting is a "release" type.
func (Profile) String ¶
String implements 'fmt.Stringer' for 'Profile' according to the profile names passed to SCons during compilation.
func (*Profile) UnmarshalText ¶
type SCons ¶
type SCons struct { // CCFlags are additional 'CFLAGS' to append to the SCons build command. // Note that 'CCFLAGS=...' will be appended *before* 'ExtraArgs'. CCFlags []string `toml:"ccflags"` // CFlags are additional 'CFLAGS' to append to the SCons build command. Note // that 'CFLAGS=...' will be appended *before* 'ExtraArgs'. CFlags []string `toml:"cflags"` // CXXFlags are additional 'CXXFLAGS' to append to the SCons build command. // Note that 'CXXFLAGS=...' will be appended *before* 'ExtraArgs'. CXXFlags []string `toml:"cxxflags"` // Command contains arguments used to invoke SCons. Defaults to ["scons"]. Command []string `toml:"command"` // ExtraArgs are additional arguments to append to the SCons build command. ExtraArgs []string `toml:"extra_args"` // LinkFlags are additional flags passed to the linker during the SCons // build command. LinkFlags []string `toml:"link_flags"` // PathCache is the path to the SCons cache, relative to the manifest. PathCache Path `toml:"cache_path"` }
SCons defines options and settings for use with the Godot build system.
func (*SCons) Configure ¶
func (c *SCons) Configure(inv *Invocation) error