Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func Checksum ¶ added in v0.3.0
Checksum produces a checksum hash of the export template specification. When the checksums of two 'Template' definitions matches, the resulting export templates will be equivalent.
NOTE: This implementation relies on producers of 'Template' to correctly register all file system dependencies within 'Paths'.
func EncryptionKeyFromEnv ¶ added in v0.2.2
func EncryptionKeyFromEnv() string
EncryptionKeyFromEnv returns the encryption key set via environment variable.
func Name ¶ added in v0.2.2
Name returns the base name of the export template defined by the specified parameters.
func NewVendorGodotAction ¶ added in v0.3.0
func NewVendorGodotAction(src *engine.Source, rc *run.Context) action.WithDescription[action.Function]
NewVendorGodotAction creates an 'action.Action' which vendors Godot source code into the build directory.
Types ¶
type Build ¶ added in v0.2.2
type Build struct { // Arch is the CPU architecture of the Godot export template. Arch platform.Arch // CustomModules is a list of paths to custom modules to include in the // template build. CustomModules []osutil.Path `hash:"ignore"` // Ignore; paths are separately hashed. // CustomPy is a path to a 'custom.py' file which defines export template // build options. CustomPy osutil.Path `hash:"ignore"` // Ignore; path is separately hashed. // DoublePrecision enables double floating-point precision. DoublePrecision bool // EncryptionKey is an encryption key to embed in the export template. // // NOTE: While this could just be set in 'Env', exposing it here simplifies // setting it externally (i.e. via the 'target' command). EncryptionKey string // Env is a map of environment variables to set during the build step. Env map[string]string // Source is the source code specification for the build. Source engine.Source // Optimize is the level of optimization for the Godot export template. Optimize engine.Optimize // Platform defines which OS/platform to build for. Platform platform.OS // Profile is the optimization level of the template. Profile engine.Profile // SCons contains a specification for how to invoke the compiler. SCons SCons }
Build uniquely specifies a compilation of a Godot export template.
type SCons ¶ added in v0.2.2
type SCons struct { // CCFlags are additional 'CFLAGS' to append to the SCons build command. // Note that 'CCFLAGS=...' will be appended *before* 'ExtraArgs'. CCFlags []string `hash:"set" toml:"ccflags"` // CFlags are additional 'CFLAGS' to append to the SCons build command. Note // that 'CFLAGS=...' will be appended *before* 'ExtraArgs'. CFlags []string `hash:"set" toml:"cflags"` // CXXFlags are additional 'CXXFLAGS' to append to the SCons build command. // Note that 'CXXFLAGS=...' will be appended *before* 'ExtraArgs'. CXXFlags []string `hash:"set" toml:"cxxflags"` // CacheSizeLimit is the limit in MiB. CacheSizeLimit *uint32 `hash:"ignore" toml:"cache_size_limit"` // Ignore; doesn't affect binary. // Command contains arguments used to invoke SCons. Defaults to ["scons"]. Command []string `hash:"set" toml:"command"` // ExtraArgs are additional arguments to append to the SCons build command. ExtraArgs []string `hash:"set" toml:"extra_args"` // LinkFlags are additional flags passed to the linker during the SCons // build command. LinkFlags []string `hash:"set" toml:"link_flags"` // PathCache is the path to the SCons cache, relative to the manifest. PathCache osutil.Path `hash:"ignore" toml:"cache_path"` // Ignore; doesn't affect binary. }
SCons defines options and settings for use with the Godot build system.
func (*SCons) CacheSizeLimitFromEnv ¶ added in v0.2.2
CacheSizeLimitFromEnv returns a SCons cache size limit set via environment variable.
func (*SCons) ExtraArgsFromEnv ¶ added in v0.2.2
ExtraArgsFromEnv returns extra SCons arguments set via environment variable.
func (*SCons) PathCacheFromEnv ¶ added in v0.2.2
PathCacheFromEnv returns a SCons cache path set via environment variable.
type Template ¶
type Template struct { // Arch is a record of the overall architecture that's being targeted. This // exists for convenience when exporting, since some templates may be have // multiple builds and the correct architecture label opaque as a result. Arch platform.Arch `hash:"ignore"` // Builds is a list of export template compilation definitions that are // required by the resulting export template artifact. Builds []Build `hash:"set"` // ExtraArtifacts are the base names of export template artifacts which are // expected to be found in the 'bin' directory post-compilation. If these // are missing, 'gdbuild' will consider the build to have failed. Note that // the artifacts pertaining to 'Builds' do not need to be specified. ExtraArtifacts []string `hash:"ignore"` // Paths is a list of additional files and folders which this template // depends on. Useful for recording dependencies which are defined in // otherwise opaque properties like 'Hook'. Paths []osutil.Path `hash:"set"` // Prebuild contains an ordered list of actions to execute prior to // compilation of the export templates. Prebuild action.Action `hash:"string"` // Postbuild contains an ordered list of actions to execute after // compilation of the export templates. Postbuild action.Action `hash:"string"` }
Template defines a Godot export template compilation. Its scope is limited to the compilation step.
func (*Template) Artifacts ¶
Artifacts returns the set of export template artifacts required by the underlying template build definition. This will join the files generated by the included 'Binary' definitions with those added in 'ExtraArtifacts'.
func (*Template) RegisterDependencyPath ¶
RegisterDependencyPath is a convenience function for registering a 'Path' dependency, but only if it hasn't been added yet.