build

package
v1.27.5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MPL-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package build supports building and testing Encore applications with codegen and rewrite overlays.

Package build supports building and testing Encore applications with codegen and rewrite overlays.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTestFailed = errRange.New("Test Failure", "One or more more tests failed.")
)

Functions

func Test

func Test(ctx context.Context, cfg *TestConfig)

Types

type Config

type Config struct {
	// Ctx controls the build.
	Ctx *parsectx.Context

	// Overlays describes the code generation overlays to apply,
	// in the form of rewritten files or generated files.
	Overlays []overlay.File

	// KeepOutput keeps the temporary build directory from being deleted in the case of failure.
	KeepOutput bool

	// Env are additional environment variables to set.
	Env []string

	// MainPkg is the main package to build.
	MainPkg paths.Pkg

	// NoBinary specifies that no binary should be built.
	// It's used if MainPkg specifies multiple packages,
	// which for example is the case when checking for compilation errors
	// without building a binary (such as during tests).
	NoBinary bool

	// StaticConfig is the static config to embed into the binary.
	StaticConfig *config.Static
}

type Result

type Result struct {
	Dir paths.FS
	Exe paths.FS
}

func Build

func Build(ctx context.Context, cfg *Config) *Result

type TestConfig

type TestConfig struct {
	Config

	// Args are additional arguments to "go test".
	Args []string

	// Stdout specifies the stdout to use.
	Stdout io.Writer

	// Stderr specifies the stderr to use.
	Stderr io.Writer

	// WorkingDir is the working directory to invoke
	// the "go test" command from.
	WorkingDir paths.FS
}

Jump to

Keyboard shortcuts

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