build

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(opts ...option)

func Services

func Services(
	ctx context.Context,
	svcs []service.ServiceWithSource,
	opts Options,
) error

Services builds the given services, aggregating them by repo root to efficiently build subdirs.

func WithStrategy

func WithStrategy(
	name string,
	detector Detector,
	supersedes []string,
) option

Types

type Builder

type Builder interface {
	// Root gives the root directory the builder targets.
	Root() string
	// BuildAll builds the whole repo
	BuildAll(context.Context, Options) error
	// ValidateSubdirs checks which subdirs are valid to pass to BuildDirs. It
	// should return _relative_ paths.
	ValidSubdirs(context.Context) ([]string, error)
	// BuildDirs builds the specified subdirs. It should expect relative paths,
	// tolerating both presence and absence of a leading `./` or the
	// platform-specific equivalent. It may return an error if any of the dirs is
	// not in what ValidSubdirs would return. It may also do a sensible build if
	// it can infer a sensible one, e.g. building the nearest parent dir.
	BuildDirs(ctx context.Context, dirs []string, opts Options) error
}

Builder represents a tool that can build a repo, or a set of subdirs within the repo.

func DetectStrategy

func DetectStrategy(root string) (string, Builder, error)

func TryStrategy

func TryStrategy(root, strategy string) (Builder, error)

type Detector

type Detector func(root string) (Builder, error)

type Options

type Options struct {
	Verbose bool
}

func (Options) ShellOpts

func (o Options) ShellOpts() []shx.Option

Jump to

Keyboard shortcuts

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