build

package
v2.12.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package build provides the API for external builders

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dependencies

func Dependencies(ctx *context.Context) []string

Dependencies returns all dependencies from all builders being used.

func Register

func Register(name string, builder Builder)

Register registers a builder to a given name.

Types

type Builder

type Builder interface {
	WithDefaults(build config.Build) (config.Build, error)
	Build(ctx *context.Context, build config.Build, options Options) error
	Parse(target string) (Target, error)
}

Builder defines a builder.

func For

func For(name string) Builder

For gets the previously registered builder for the given name.

type ConcurrentBuilder

type ConcurrentBuilder interface {
	AllowConcurrentBuilds() bool
}

ConcurrentBuilder can be implemented to indicate whether or not this builder support concurrent builds.

type DependingBuilder

type DependingBuilder interface {
	Dependencies() []string
}

DependingBuilder can be implemented by builders that have dependencies.

type Options

type Options struct {
	Name   string
	Path   string
	Ext    string // with the leading `.`.
	Target Target
}

Options to be passed down to a builder.

type PreparedBuilder

type PreparedBuilder interface {
	Prepare(ctx *context.Context, build config.Build) error
}

PreparedBuilder can be implemented to run something before all the actual builds happen.

type Target

type Target interface {
	// String returns the original target.
	String() string

	// Fields returns the template fields that will be available for this
	// target (e.g. Os, Arch, etc).
	Fields() map[string]string
}

Target represents a build target.

Each Builder implementation can implement its own.

type TargetFixer

type TargetFixer interface {
	FixTarget(target string) string
}

TargetFixer allows the builder to provide a way to "default" an incomplete target, e.g., on Go, 'darwin_arm64' would need to be defaulted to 'darwin_arm64_v8.0'.

Jump to

Keyboard shortcuts

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