run

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 12 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 NewVerifyArtifactsAction

func NewVerifyArtifactsAction(
	rc *Context,
	artifacts []string,
) action.WithDescription[action.Function]

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

Types

type Context

type Context struct {
	// DryRun determines whether the specified command will be executed.
	DryRun bool
	// 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) 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