build

package
v1.44.6 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MPL-2.0 Imports: 26 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

View Source
const BinaryName = "encore_app_out"

Variables

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

Functions

func RunTests added in v1.34.0

func RunTests(ctx context.Context, spec *TestSpec, cfg *RunTestsConfig)

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 GenerateTestSpecConfig added in v1.34.0

type GenerateTestSpecConfig struct {
	Config

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

type Result

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

func Build

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

type RunTestsConfig added in v1.34.0

type RunTestsConfig struct {
	// 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
}

type TestConfig

type TestConfig struct {
	GenerateTestSpecConfig
	RunTestsConfig
}

type TestSpec added in v1.34.0

type TestSpec struct {
	Command string
	Args    []string
	Environ []string
	// contains filtered or unexported fields
}

func GenerateTestSpec added in v1.34.0

func GenerateTestSpec(ctx context.Context, cfg *GenerateTestSpecConfig) *TestSpec

Jump to

Keyboard shortcuts

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