run

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func NewCopyArtifactsAction added in v0.3.0

func NewCopyArtifactsAction(
	rc *Context,
	root osutil.Path,
	artifacts []string,
) action.Action

NewCopyArtifactsAction creates an 'action.Action' which moves the generated Godot artifacts to the output directory.

func NewVerifyArtifactsAction

func NewVerifyArtifactsAction(
	_ *Context,
	root osutil.Path,
	artifacts []string,
) action.WithDescription[action.Function]

NewVerifyArtifactsAction creates an 'action.Action' which verifies that all required artifacts have been generated.

func NewWaitAction added in v0.3.18

NewWaitAction creates an 'action.Action' which blocks the thread for the specified duration.

Types

type Context

type Context struct {
	// DryRun determines whether the specified command will be executed.
	DryRun bool
	// Target is the name of the target specified during an export command.
	//
	// HACK: Context should realistically be divided into per-command contexts
	// so that properties can be specialized. For now, deal with this. It's only
	// set for 'gdbuild target'.
	Target string

	// 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 platform.OS
	// Profile is the GDBuild optimization level to build with.
	Profile engine.Profile

	// PathManifest is the path to the GDBuild manifest. This is used to locate
	// relative paths in various other properties.
	PathManifest osutil.Path
	// PathOut is the directory in which to move built artifacts to.
	PathOut osutil.Path
	// PathWorkspace is a working directory in which to run relevant commands.
	// The use case for the directory is command-specific.
	PathWorkspace osutil.Path
	// contains filtered or unexported fields
}

Context contains 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 (*Context) BinPath

func (c *Context) BinPath() osutil.Path

BinPath returns the path to the Godot template artifacts are compilation.

func (*Context) GodotPath added in v0.3.4

func (c *Context) GodotPath() osutil.Path

GodotPath returns the path to the Godot editor executable.

func (*Context) GodotProjectManifestPath added in v0.2.3

func (c *Context) GodotProjectManifestPath() osutil.Path

GodotProjectManifestPath returns the path to the Godot project manifest file.

func (*Context) HasTempDir added in v0.2.3

func (c *Context) HasTempDir() bool

HasTempDir returns whether a run-specific temporary directory has been created.

func (*Context) TempDir added in v0.2.3

func (c *Context) TempDir() (string, error)

TempDir constructs a temporary directory for the duration of the context. Only one directory will ever be created.

func (*Context) Validate

func (c *Context) Validate() error

type Hook

type Hook struct {
	// Pre contains a command to run *before* an export step.
	Pre []action.Command `toml:"run_before"`
	// Post contains a command to run *after* an export step.
	Post []action.Command `toml:"run_after"`
	// 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.

func (Hook) PostActions

func (h Hook) PostActions(rc *Context) action.Action

PostActions is a utility function to convert post-build commands into a slice of 'Action' types.

func (Hook) PreActions

func (h Hook) PreActions(rc *Context) action.Action

PreActions is a utility function to convert pre-build commands into a slice of 'Action' types.

func (Hook) Validate

func (h Hook) Validate(_ *Context) error

Jump to

Keyboard shortcuts

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